var oldArr =[
{name:"zhangs"},
{name:"zhang"},
{name:"zhanga"}
{name:"zhang"}];
var allArr=[];
$.each.(olDArren,function(i,v){
var flag=true;
if(allArr.length>0){
$.each(allArr,function(n,m){
if(allArr[n].name==oldArr[i].name){
flag=false;
}
if(flag){
allArr.push(oldArr[i])
}
})
}
});
console.log(allArr)
网友评论