Facebook
From Baby Sheep, 5 Years ago, written in Plain Text.
This paste is a reply to Untitled from Crippled Horse - go back
Embed
Viewing differences between Untitled and Re: Untitled
var x = [[1, 2],[3, 4],[5, 6]];
var y = [];
var i = 0;

while ( i < x[0].length) {
  x.forEach(function(item, index) {
    y[i][index] = x[index][i];
  })
  i++
}

console.log(y);