var Universities = [{
"State": "ILLINOIS",
"University": "North Park University",
"Place": "Chicago"
}, {
"State": "VERMONT",
"University": "University of Vermont",
"Place": "Berlington"
}, {
"State": "FLORIDA",
"University": "North Wood University",
"Place": "Midland"
}, {
"State": "NEW YORK",
"University": "Pace State University(undergradations& post graduations",
"Place": "NY"
}, {
"State": "ILLINOIS",
"University": "University of North Alabama",
"Place": "Florence"
}, {
"State": "ILLINOIS",
"University": "Louisiana Technology University",
"Place": "Ruston"
}, {
"State": "North Carolina",
"University": "East Carolina University",
"Place": "Green Ville"
}, {
"State": "ARKANSAS",
"University": "Arkansas State University",
"Place": "Jones boro"
}, {
"State": "Oklahoma",
"University": "University of Tulsa",
"Place": "Tulsa"
}, {
"State": "ILLINOIS",
"University": "Rush University",
"Place": "Chicago"
}]
UNIVERSITIES
州有多少ILLINOIS
?
请检查并帮助我。
答案 0 :(得分:1)
如果我正确理解你的问题,也许使用filter
可以弄清楚:
var result = Universities.filter(function (ele) {
return ele.State == 'ILLINOIS';
});
console.log(result);