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)];

Comments

Popular posts from this blog

world tourism guide Template

Es6 how to check if value is not null or undefined?