- 数组去重
//对arr去重
var hash = {};
var arr = [{
type: 1
},
{
type: 1
},
{
type: 2
}
]
arr = arr.reduce(function (item, next) {
hash[next.type] ? '' : hash[next.type] = true && item.push(next);
return item
}, [])
2;数组中对象去重
https://www.cnblogs.com/caideyipi/p/7679681.html
https://www.cnblogs.com/le220/p/9130656.html