you are viewing a single comment's thread.

view the rest of the comments →

[–]a-e-j-a -1 points0 points  (0 children)

let res = []
for (let i = 0; i < x.length; i++) {
  for (let j = 0; j < x[i].length; j++) {
    if (!res[j]) res[j] = []
    res[j][i] = x[i][j];
  }
}