I have this array:
rows = [ [ 89, 18, 9 ], [ 1903, 3, 4 ], [ 3, 1, 800 ] ];
It should look like this:
[ [ 89, 1903, 3 ], [ 18, 3, 1 ], [ 9, 4, 800 ] ]
And the code, that is working, looks like this:
rows[0].map((_, columnIndex) => rows.map(
row => row[columnIndex])
);
How does this work?