any ideas to convert this JSON object to different arrays from the object keys?
json= [
{ "Count": 6, "plant": 18, "Stressed": 4 },
{ "Count": 9, "plant": 19, "Stressed": 5 },
{ "Count": 4, "plant": 15, "Stressed": 3 }
]
Expected arrays:
count=[6,9,4];
plant=[18,19,15];
Stressed=[4,5,3] ;
I'm trying something like this but does not work:
$.each(json, function (k, v) {
var arr = Array.from(Object.keys(v),k=>v[k]);
console.log(arr);
})