• Reverses the given array

    Type Parameters

    • E

    Parameters

    • Optionalarray: null | E[]

      the arrays to inspect

    • OptionalstartInclusive: number

      the starting index, inclusive

    • OptionalendExclusive: number

      the ending index, exclusive

    Returns E[] | undefined | null

    reverse(undefined);    // undefined
    reverse(['foo', 'bar']); // ['bar', 'foo']
    reverse(['foo', 'bar'], 0, 1); // ['foo']