首页 > 技术文章 > js 数组合并并去重

quepq 2020-04-17 18:02 原文

let arr = this.defaultToCc.concat(item.copyFor);  //合并数组

let arrNew= new Set(arr); //通过set集合去重

let cc = Array.from(arrNew);
console.log("arrNew",Array.from(arrNew)); //将set集合转化为数

推荐阅读