You can do it simply with ES6ECMAScript 6,
var array1 = ["Vijendra", "Singh"];
var array2 = ["Singh", "Shakya"];
var array3 = [...new Set([...array1 ,...array2])];
console.log(array3); // ["Vijendra", "Singh", "Shakya"];
- Use the spread operator for concatenating the array.
- Use Set for creating a distinct set of elements.
- Again use the spread operator to convert the Set into an array.