How to merge two array and remove duplicate es6
To merge two array we can use spread operator and remove duplicate
const arr1 = ["abc","efg"];
const arr2 = ["efg", "pqr"];
const arr3 = [...array1, ...array2];
const result = [...new Set([arr3)];To merge two array we can use spread operator and remove duplicate
const arr1 = ["abc","efg"];
const arr2 = ["efg", "pqr"];
const arr3 = [...array1, ...array2];
const result = [...new Set([arr3)];
Comments