How to separate value based on key in javascript? -


this code meant print action key value:

result [       { action: 'test' },     { action: 'tests' },     { action: 'tested' }  ];    (value = 0; value <= result.length; value ++) {     response = this.actions[value]['action'];     alert("actions are: " + response);  } 

however, causes error: action cannot read property.

the actions in code not defined, try:

result =  [  {action: 'test'},        {action: 'tests'},        {action: 'tested'} ];    for(value = 0; value <=result.length; value ++) {     response = this.result[value]['action'];    alert("actions are: " +response); } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -