Function rotateArray

  • Create a new array by rotating another array.

    Type Parameters

    • T

    Parameters

    • input: readonly T[]

      The initial array.

    • by: number

      How many places to rotate left. Negative values mean to the right. This should be a 32 bit integer. 0 and large numbers are handled efficiently.

    Returns readonly T[]