js how to invert columns and rows code example Example: transpose an array in javascript array[0].map((_, colIndex) => array.map(row => row[colIndex]));