// 数组去重
const hash = {};
const newArray = data.reduce((item, next)=>{
hash[next.name] ? '' : hash[next.name] = true && item.push(next);
return item;
},[])
const hash = {};
const newArray = data.reduce((item, next)=>{
hash[next.name] ? '' : hash[next.name] = true && item.push(next);
return item;
},[])
展开
3
1