Nested Arrays

Total Post:113


 283  View(s)
Rate this:

Nested Arrays in JSON Objects ?

  1. Re: Nested Arrays

    Arrays as JSON Objects :

    JSON array are almost the same as arrays in JS. Values must be string, number, object, array, boolean or null type in JSON array. 

    Example : 

    [ "Allahabad", "Kanpur", "Varansi" ]

    Array values by using a for-in loop: 

    for (i in { 
        x +=[i];

    Nested Arrays in JSON Objects: 

    myObj = { 
        "city": [
            { "name":"Allahabad", "models":[ "Sangam"] },
            { "name":"Kanpur", "models":[ "Industrial"] },
            { "name":"Varansi", "models":[ "Devnagari" ] }
    delete[1];    //Delete array 


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.