How to Merge Two Arrays in JavaScript and De-duplicate Items
In this tutorial, you will learn how to merge two Arrays in JavaScript. However, the methods depend on the version you’re using.
ES5 Version
This version uses the concat() method to merge two arrays:

The concat() method merges two or more arrays not changing the existing arrays, but returns a new array.
To remove duplicates, the filter() method can be used:

ES6 Version
This version uses the destructuring method for merging two Arrays.

The push() method is an alternate way to merge two Arrays.

To remove duplicates, Set is used. The Set object is used to store unique values of primitive values or object references.

Arrays
The JavaScript Arrays class is a global object used in the construction of arrays, which are high-level and list-like objects. You can use arrays for storing several values in a single variable. An array can be described as a unique variable that is capable of holding more than one value simultaneously.