- 第1种
去掉后返回新数组newArr
const newArr = list.filter(item=> list2.some(item2=> item2.id2!== item.id));
- 第2种
去掉后返回新数组newArr
const newArr2 = new Set(list2.map(item2 => item2.id2));
const newArr = list.filter(item => !newArr2.delete(item.id));
- 第3种
去掉后返回新数组newArr
const newArr2 = new Set(list2.map(item2 => item2.id2));
const newArr = list.filter(item => !newArr2.has(item.id));