javascript - console.log not showing js value -


i iterating through json data...but not able value in console.log can guys tell me how fix it.. writing correct syntax console.. providing code below...

http://jsfiddle.net/7bn63/4/

function allprofile() {     (var = 0; < allprofile.length; i++) {         console.log("i here");         console.log(allprofile[i].class of service 1);     } }  var allprofile = [{     profile: 101,         'class of service 1': '90%'  }]; 

you'll have use bracket notation access property

allprofile[i]['class of service 1'] 

and function has same name object, it's overwritten

function iterator() {     (var = 0; < allprofile.length; i++) {         console.log(allprofile[i]['class of service 1']);     } }  var allprofile = [{     profile: 101,     'class of service 1': '90%' }];  iterator(); 

fiddle


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -