首页 > 编程语言 > 详细

数组对象按某属性去重

时间:2021-06-01 15:10:42      阅读:16      评论:0      收藏:0      [点我收藏+]

数组对象按某属性去重

 

  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")
 

 

 

数组对象按某属性去重

原文:https://www.cnblogs.com/123poi/p/14835715.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!