vue 去重数组中的对象

时间:2021-04-28 12:04:33   收藏:0   阅读:0
    unique(arr) {
      const res = new Map();
      return arr.filter(
        (arr) => !res.has(arr.strat_id) && res.set(arr.strat_id, 1)
      );
    },
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!