disposeArray(data){
const newArray = [];
data.forEach((currentValue) => {
let isPush = true;
newArray.forEach((currentValueIn) => {
if(currentValueIn) {
if(currentValue.label === currentValueIn.label){
isPush = false;
}
}else{
newArray.push(currentValue)
}
})
if(isPush) {
newArray.push(currentValue)
}
})
return newArray;
}
二维数组去重
最新推荐文章于 2022-10-26 14:38:02 发布