• Rotates a list a number of times. It"s completly agnostic about the contents of the list.

    Type Parameters

    • T

    Parameters

    • times: number

      the number of rotations

    • arr: T[]

    Returns T[]

    the rotated collection

    Example

    rotate(1, [1, 2, 3]) // => [2, 3, 1]