答案 0 :(得分:0)
您可以这样做
var first = ["name0", "name1", "name2"]
var second = { {"name2":"xyz", "name0" : "xyz", "name1" : "xyz" } }
for( var i = 1; i < Object.keys(second).length; i++ ){
var aux = {}
first.forEach(function(element2) {
resul[element2] = second[i][element2]
});
}