数组去重

普通数组去重

vm.bleDevices = Array.from(new set(vm.bleDevices))

对象数组去重

unique(arr) {
      const res new Map();
      return arr.filter((arr) => !res.has(arr.mac) && res.set(arr.mac, 1));

 

posted @ 2021-09-27 14:27  卡布奇诺。不加糖  阅读(19)  评论(0)    收藏  举报