// merge tow tags (old and new) var oldTags = [1,2,3,4] ; var newTags = [2,3,5,7] ; var tags = oldTags.concat(newTags); // remove duplicated items var newTags = (tags) ? tags.filter((item, pos) => tags.indexOf(item) === pos) : '' ;