// 去除重复订单对象
var data=[ {id:1,name:123}, {id:1,name:123}, {id:2,name:123}, {id:2,name:123}, {id:1,name:123} ] let hash = {}; data =data.reduce((preVal, curVal) => { hash[curVal.id] ? '' : hash[curVal.id] = true && preVal.push(curVal); return preVal }, [])