js 两个数组对比 如果第二个数组里存在第一个数组没有id的项就push进第一个数组

66 阅读1分钟
  let newArr = a.concat(b)//先把两个数组合并
  let some = [];
    newArr.forEach(el => {
      if (!some.some(e => e.tydm == el.tydm)) {
       some.push(el);
      }
  });