Facebook
From Buff Agouti, 3 Years ago, written in Plain Text.
This paste is a reply to Untitled from Crippled Horse - view diff
Embed
Download Paste or View Raw
Hits: 236
  1. var x = [[1, 2],[3, 4],[5, 6]];
  2. var y = [];
  3. var temp = [];
  4. var i = 0;
  5.  
  6. while ( i < x[0].length) {
  7.   var c = 0;
  8.   while ( c < x.length ) {
  9.     y[c] = x[c][i] ;
  10.     c++
  11.  
  12.   }
  13.   //console.log(y);
  14.   temp.push(y);
  15.   i++
  16. }
  17.  
  18. console.log(temp);