js如何获取以下数组的名Name,mobile

JavaScript015

js如何获取以下数组的名Name,mobile,第1张

var text=[{ "Id" : "8a948bf24a510afa0", "Name" : "cc", "Type" : "YY", "attributes" : { "email" : "", "mobile" : "123",}, "parentId" : "8A948A5148EF6F000A"},

{ "Id" : "8acsdasdsad0", "Name" : "gg", "Type" : "YY", "attributes" : { "email" : "", "mobile" : "333",}, "parentId" : "8A948A5148EF6F000A"}]

var last=""

for(var i=0i<text.lengthi++){

for(var ii in text[i]){

if(ii=="Name"||ii=="mobile"){

last+=text[i][ii]

}

for( var jj in text[i][ii]){

if(jj=="mobile"||jj=="Name"){

last+=text[i][ii][jj]

}

}

}

}

}

alert(last)

var count=obj.count //obj是上面的对象

for(var name in count){

console.log(name) //name为遍历的属性,分别为dingdone和wechat

}