How to merge two arrays in JavaScript and de-duplicate items How to merge two arrays in JavaScript and de-duplicate items arrays arrays

How to merge two arrays in JavaScript and de-duplicate items


To just merge the arrays (without removing duplicates)

ES5 version use Array.concat:

var array1 = ["Vijendra", "Singh"];var array2 = ["Singh", "Shakya"];console.log(array1.concat(array2));