js 数组合并并去重

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集合转化为数

猜你喜欢

转载自www.cnblogs.com/quepq/p/12721555.html