从数组arr1中删除数组arr2中存在的元素
let arr1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
let arr2=[{ id: 1 }, { id: 2 }];
let newArr = arr1 .filter((x) => !arr2.some((item) => x.id === item.id));
let arr1 = [{ id: 1 }, { id: 2 }, { id: 3 }];
let arr2=[{ id: 1 }, { id: 2 }];
let newArr = arr1 .filter((x) => !arr2.some((item) => x.id === item.id));