[Solved] How to parse Json response inside square brackets?


Just like you’d traverse any other array. Simply, instead of having their properties stored under property names in a map, the objects that make up this array have their properties stored under given indexes in an array.

theJsonObject.rows.forEach( function(row) {
    var url = row[0];
    var n = row[1];
    do stuff with url and n...
});

forEach could be replaced by anything appropriate for the particular circumstances. For instance, if you’d like to transform it into an array of regular objects with named properties :

var withNamedProperties = theJsonObject.rows.map( function(row) {
    return {
        url:row[0],
        n:row[1]
    };
});

3

solved How to parse Json response inside square brackets?