Sunny-117 / js-challenges

✨✨✨ Challenge your JavaScript programming limits step by step

Home Page:https://juejin.cn/column/7244788137410560055

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

数组合并

Sunny-117 opened this issue · comments

let arr1 = ["A1", "A2", "B1", "B2", "C1", "C2"]
let arr2 = ["A", "B", "C"];
// res=['A1', 'A2', 'A', 'B1', 'B2', 'B', 'C1', 'C2', 'C']
console.log([...new Set(arr1.concat(arr2))])