数组对象按某属性去重

数组对象按某属性去重

 

  uniqueFun(arr, type) {
    const res = new Map();
    return arr.filter((a) => !res.has(a[type]) && res.set(a[type], 1));
  },


var alllist = that.uniqueFun(that.data.allList.concat(newarr).reverse(),"CheckType")
 

 

 
posted @ 2021-06-01 09:23  小夜猫啊  阅读(186)  评论(0编辑  收藏  举报