// 去重
deduplicateArray(arr, props) {
return arr.reduce((result, obj) => {
const existingObj = result.find(item => item[props] === obj[props]);
if (!existingObj) {
result.push(obj);
}
return result;
}, []);
}
根据某一属性去重
最新推荐文章于 2024-07-29 15:37:55 发布