The JSON I have:
[{"one":"a","two":"1","three":"2","four":"3"},
{"one":"b","two":"4","three":"5","four":"6"},
{"one":"c","two":"7","three":"8","four":"9"}]
The array that I need:
[[[1,"a"], [4,"b"], [7,"c"]],
[[2,"a"], [5,"b"], [8,"c"]],
[[3,"a"], [6,"b"], [9,"c"]]]
How can I treat the JSON to transform it in an array of arrays?
I need to do it dynamically because the JSON could be bigger (more rows a, b, c, ...z). The 4 columns are fixed(one,two,three,four) and won't change.
I have tried several ways...to do it with .push, creating an array=[[]], trying array=new array(3) and then in each position making array[0]=new array[], but i didn't solved yet, I have passed all day trying this, all day!
I think the solution is using push like here related subject But I don't understand this solution very well.
I would appreciate your help please.