How to count JSON objects

前端 未结 6 420
北海茫月
北海茫月 2020-12-15 09:42

Here is my JSON:

[
    {
        \"id\": \"38\",
        \"article_id\": \"16\",
        \"news_event\": \"625\",
        \"language\": \"en\",
        \"cha         


        
6条回答
  •  感情败类
    2020-12-15 10:09

    Assuming it's in the variable foo, foo.length.

    var foo = [{...},{...},...];
    alert(foo.length);
    foo[0].id// 38;
    

提交回复
热议问题