Question

How do I get the JSON sub objects without using pop() operation. I have multilevel JSON. Just like this:

   [
      { a:'a',
        b:'b'
      },
      {
        a:'aa',
        b:'bb',
        c: [
             {d:'d'},
             {e:'e'}
           ]
      }
   ]

How can I access to each of these elements?

Was it helpful?

Solution

data[1].c[1].e will return 'e' assuming your json object is named 'data'

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top