我想根据浏览器值计算浏览器条目的总数。
即,我的意思是在以下json
数据中我想计算总数"IE8"
和"FF20
“"GC23"
我想打印
var ie =2
var gc =1
var ff =3
怎么可能
serverResult.forEach(function (lists) {
alert(JSON.stringify(lists))
//it outputs the following data
{ "jobid" : "86", "browser" : "IE8", "_id" : ObjectId("524a7fe53d62ccac12000004") }
{ "jobid" : "34", "browser" : "FF20", "_id" : ObjectId("524a7feb3d62ccac12000005") }
{ "jobid" : "4", "browser" : "IE8", "_id" : ObjectId("524a7ffd3d62ccac12000006") }
{ "jobid" : "34", "browser" : "FF20", "_id" : ObjectId("524a801c3d62ccac12000007") }
{ "jobid" : "4", "browser" : "GC23", "_id" : ObjectId("524a80343d62ccac12000008") }
{ "jobid" : "4", "browser" : "FF20", "_id" : ObjectId("524a84fea6af63fb12000001") }
});