直接上代码: //return an array of objects according to key, value, or key and value matching function getObjects(obj, key, val) { var objects = ; for (var i in obj) { if (!obj.hasOwnProperty(i)) continue; if (typeof obj[i] ==