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...
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();
Comments
Post a Comment