如上圖所示,一個高效的代碼是:spa
var newArray = arr[0].map(function(col, i) { return arr.map(function(row) { return row[i]; }); });