Transposes the rows and columns. Passing an infinite list will hang forever.
The source list of list.
The transposed list.
const matrix = fromArray([fromArray([1, 2, 3]), fromArray([4, 5, 6])]);const transposed = transpose(matrix);const actual = toArray(transposed).map((col) => toArray(col));expect(actual).toStrictEqual([ [1, 4], [2, 5], [3, 6],]); Copy
const matrix = fromArray([fromArray([1, 2, 3]), fromArray([4, 5, 6])]);const transposed = transpose(matrix);const actual = toArray(transposed).map((col) => toArray(col));expect(actual).toStrictEqual([ [1, 4], [2, 5], [3, 6],]);
Transposes the rows and columns. Passing an infinite list will hang forever.