前端 当两个数组合并时 a,b

c= a.concat(b)
let result=[];
let temp ={};
c.forEach(p-> {
if(!temp[p.主键]){
result.push(p);
temp[p.主键]=true;
}
})

posted @ 2021-01-13 18:23  learning豪  阅读(154)  评论(0编辑  收藏  举报