一般的数组去重
let a=[1,2,3,4]
let b=[3,4,5]
let union=[...new Set([...a,...b])]
数组中的对象去重
let jsonArray=[{id:'1',result:'xx'},{id:'2',result:'x'}]
let b=[{id:'1',result:'xx'},{id:'3',result:'ll'}]
let c=[...jsonArray,...b]
let d=[]
**关键点
let hash={}
d=c.reduce((item,next)=>{
hash[next.id]?'':hash[next.id]=true&&item.push(next)
return item
},[])