您可以使用Array.filter
var data = [{ "id": 1, "term_id": 5, "type": "car" }, { "id": 2, "term_id": 3, "type": "bike" }, { "id": 3, "term_id": 6, "type": "car" }];var result = data.filter(function(v, i) { return ((v["term_id"] == 5 || v["term_id"] == 6) && v.type == "car");})console.log(result)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)