let arr1 = [{id:1},{id:2},{id:3},{id:4},{id:5},{id:6}]
let arr2 = [{id:2},{id:3},{id:4}]
let arrList1 = arr1.map(item => item.id)
console.log("arr1List ------>",arr1List)
let arrList2 = arr2.filter(item => !arrList1.includes(item.id))
console.log("arrList2 ------>",arrList2 )
// arrList2 为最终结果
记录删除两数组中相同的数据
最新推荐文章于 2022-09-20 09:38:26 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)