匹配两个数组对象中某个元素是否相等
为true则向目标数组添加新属性
let arr1 = [{id:3,b:2,a:"hello"},{id:2,b:3,a:"asas"}];
let arr2 = [{id:2,pr:302},{id:1,pr:301},{id:3,pr:306}];
arr1.forEach((item,index1)=>{
arr2.forEach((item2,index2)=>{
if(item.id == item2.id) {
arr1[index1].pr = item2.pr
}
})
})
console.log(arr1);