对象内容
let empListData = [{
lastName:'lin',
phone:154393456
},
{
lastName:'lin',
phone:154393456
},{
lastName:'lin',
phone:154393456
}]
找重方法:
let newarr = empListData.filter((item,index)=>{
for (let i=0; i<empListData.length; i++) {
if(item.phone == empListData[i].phone && index!=i){
return item;
}
}
});
console.log(newarr)