Good day. I have a problem with an array: I need to combine N number of arrays for example:
var array = [
[0, 1, 2],
[3,4,5],
[6,7,8]
]
the result should be:
var newArray = [
[0,3,6],
[1,4,7],
[2,5,8]
]
the incoming array has N arrays (dynamic and with dynamic lengths).
for (let x = 0, c = data.length; x < c; x++) {
var newArray = new Array();
for (let i = 0, count = data[x].length; i < count; i++) {
newArray.push(data[x][i]);
}
final = final.concat(newArray);
}
I've tried this but it doesn't work... Any help please. Thanks for your time. slds and happy afternoon