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数组对象去重
最新推荐文章于 2024-04-11 17:12:32 发布