Function transpose

  • Transpose a 2D array if the array is not a rectangle, the transposed array will be padded with undefined

    Type Parameters

    • T

    Parameters

    • arr: T[][]

      2D array

    Returns (T | undefined)[][]

    transposed 2D array