devtypes - v2.0.0
    Preparing search index...

    Type Alias TupleDrop<T, N, C>

    TupleDrop: C["length"] extends N
        ? T
        : T extends readonly [any, ...(infer R)]
            ? TupleDrop<R, N, readonly [...C, any]>
            : readonly []

    Drop the first N elements of a tuple.

    Type Parameters

    • T extends readonly any[]

      Tuple type

    • N extends number

      Number of elements to drop

    • C extends readonly any[] = []

    Produces a new tuple with the first N elements removed. If N exceeds the tuple length, returns an empty tuple.

    type T = TupleDrop< [ 1, 2, 3, 4 ], 2 >;  // [ 3, 4 ]