I am trying to change an array which contains multiple arrays into a form that I can use for an external API.
Example:
[ [44.5,43.2,45.1] , [42, 41.2, 48.1] ]
into
[ [44.5,42], [43.2,41.2] , [45.1, 48.1] ]
Currently my code runs as this, but doesn't work
var newArr= [];
var tempArr= [];
for(var key in data){
tempArr.push(finalArr[key][key])
newArr.push(tempArr)
}
Is there some easier way to accomplish this without looping? I was thinking of maybe a map function but I'm not sure how to implement it here.