const arr1 = [1, 2, 3]; const arr2 = [3, 4, 5]; console.log(Array.from(new Set([...arr1, ...arr2])));