javascript - manipulating json data and simple for statement -
if i'm getting data array
var data = {"answer":"ok","data":[["marco","123"],["john","44245"],["wayne","645464"]]}
how can inside loop iterate trough them , print inside console coresponding values
marco 123 john 44254, .. marco - 123 john - 44245, ... (var = 0; < data.length; i++) { }
data key of data object.you need first retrieve value of data.data
return array. loop through each of these array elements values.
var data = {"answer":"ok", "data":[["marco","123"],["john","44245"],["wayne","645464"]] } var getdata = data.data; //data key array getdata.foreach(function(item){ item.foreach(function(inneritem){ console.log(inneritem) }) })
Comments
Post a Comment