Please I am trying to convert this object returned from my Web API:
[
{"a":65,"b":59,"c":80,"d":81,"e":56,"f":55,"g":40},
{"a":28,"b":48,"c":40,"d":19,"e":86,"f":27,"g":90}
]
Into array of this format inside AngularJS Controller:
[
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
]
I researched extensively & applied multiple approaches e.g. using:
var arr = $.map(o, function(el) { return el; })
var arr = Object.keys(o).map(function(k) { return o[k] });
var obj = JSON.parse(json);
Object.keys(obj).forEach(function (key) { arr[key] = obj[key] });
But none of the above worked as all I got from console.log was:
[object Object],[object Object]