寻找一个简单的 JS 来计算 .json 文件中的项目数量(在这种情况下,每个项目代表一张被拉入网络应用程序的 instagram 照片;我想计算照片的数量)。Json的结构是这样的......
{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"geometry":{
"coordinates":[
-79.40916,
43.87767
],
"type":"Point"
},
"properties":{
"longitude":-79.40916,
"latitude":43.87767,
"title":"",
"user":"cmay2400",
"id":"176051485697457528_13947894",
"image":"http:\/\/distilleryimage0.instagram.com\/1d725a3a8d7511e181bd12313817987b_7.jpg",
"images":{
"low_resolution":{
"url":"http:\/\/distilleryimage0.instagram.com\/1d725a3a8d7511e181bd12313817987b_6.jpg",
"width":306,
"height":306
},
"thumbnail":{
"url":"http:\/\/distilleryimage0.instagram.com\/1d725a3a8d7511e181bd12313817987b_5.jpg",
"width":150,
"height":150
},
"standard_resolution":{
"url":"http:\/\/distilleryimage0.instagram.com\/1d725a3a8d7511e181bd12313817987b_7.jpg",
"width":612,
"height":612
}
},
"description":"Today's ride <span class=\"tag\">#zipcar<\/span>",
"instagram_id":"13947894",
"likes":1,
"profile_picture":"http:\/\/images.instagram.com\/profiles\/profile_13947894_75sq_1322267355.jpg"
}
},
{
"type":"Feature", [...]
我只想遍历json文件并计算项目数。完全不知道从哪里开始。