[[11,12,13,], [21,22,23], [31,32,33]]
[[11,21,31,], [12,22,32], [13,23,33]]
b[j][i]=a[i][j];
function g(b) { for (var d = b.length, a = 0; a < d; a++) for (var c = a + 1; c < d; c++) { var e = b[a][c]; b[a][c] = b[c][a]; b[c][a] = e } return b }; var a = [[11,12,13],[21,22,23],[31,32,33]];// alert(a.join('\n')) alert(g(a).join('\n'));