var arr = []
var peoples = [
{id:1,name:'wang'},
{id:2,name:'zhang'},
{id:2,name:'zhang'},
]
for(let val of peoples){
arr.push(val.id)
}
var newArr = [];
var newArr2 = [];
for(var i =0;i<arr.length-1;i++){
if(newArr.indexOf(arr[i]) == -1){
newArr.push(arr[i]);
newArr2.push(peoples[i]);
}
}
peoples = newArr2;// [{id:1,name:'wang'},{id:2,name:'zhang'},]