const obj = {};
this.targetList = this.targetList.reduce((array, next) => {
obj[next.code] ? '' : obj[next.code] = true && array.push(next);
return array;
}, []);
console.log(this.targetList);
ES6数组对象去重
最新推荐文章于 2023-07-07 11:20:58 发布