对象合并去重 ,后面的覆盖前面的

let fieldArr = [...initFieldArr, ...filterNullSort]
data.fieldInfo = Array.from(fieldArr.reduce((result, item) => result.set(item.id, item), new Map()).values())

 

 

posted on 2020-01-08 11:51  冰love  阅读(862)  评论(0编辑  收藏  举报

导航