javascript - Access array element with a dot in its name -


i'm reading data database , loading in array. when print console this:

 [  {'person.name':'name1', total:1},  {'person.name':'name2', total:100}  ] 

so iterate through code:

for(var i=0;i<arr.length;i++){     console.log(arr[i].total); } 

i can access total how can access 'person.name'?

access array :

arr[i]['person.name']; 

here's more info on why/when use notation : javascript property access: dot notation vs. brackets?


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -