0

Say I have an javascript object

i = {
   data1:{
     one:'555',
     two:'222'

   },
   data2:{
   }
}

I am suprised to see that there is no way to say i{data1}{one} to arrive at answer 555.. What is the most current way to get at this data without using a for loop?

hanabbs
  • 149
  • 6

1 Answers1

1

You can easily arrive there with:

i.data1.one

or

i['data1']['one']
AdriSolid
  • 2,570
  • 1
  • 7
  • 17