(function(){//去除数组中重复对象
var unique = {};
arr.forEach(function(a){ unique[ JSON.stringify(a) ] = 1 });
arr= Object.keys(unique).map(function(u){return JSON.parse(u) });
return arr
})(arr)

let newArr=[];//去除空对象
for(let j in arr){
for(let prop in arr[j]){
if(prop!=''||arr[j][prop]!=''){
newArr.push(arr[j]);
}
}
};

相关文章:

  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-10-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
相关资源
相似解决方案