const arr2 = [{id:1,name:'张三'},{id:2,name:'李四'},{id:1,name:'张三'},{id:2,name:'李四'}]
const arr3 = [{id:1,name:'键盘'},{id:2,name:'王五'},{id:3,name:'赵六'}]
求交集:
const arr4 = arr3.filter(item=>arr2.some(x=>item.id===x.id))
求并集:
const arr5 = arr2.concat(arr3.filter(x=>arr2.every(y=>y.id !== x.id)))