您可以创建像这样的递归函数来对
cars对象进行深度优先遍历。
var findObjectByLabel = function(obj, label) { if(obj.label === label) { return obj; } for(var i in obj) { if(obj.hasOwnProperty(i)){ var foundLabel = findObjectByLabel(obj[i], label); if(foundLabel) { return foundLabel; } } } return null;};可以这样称呼
findObjectByLabel(car, "Chevrolet");



