在JavaScript中转换2D数组
[ [1,2,3], [1,2,3], [1,2,3],]
[ [1,1,1], [2,2,2], [3,3,3],]
function transposeArray(array, arrayLength){ var newArray = []; for(var i = 0; i < array.length; i++){ newArray.push([]); }; for(var i = 0; i < array.length; i++){ for(var j = 0; j < arrayLength; j++){ newArray[j].push(array[i][j]); }; }; return newArray;}
翻翻过去那场雪
MM们
慕容森