ts-type-forge
    Preparing search index...
    Tail: A extends readonly []
        ? readonly []
        : A extends readonly [unknown, ...(infer R)] ? Readonly<R> : Readonly<A>

    Gets a new readonly tuple type containing all elements of A except the first one. If A is empty or has only one element, returns readonly []. If A is a general array type, returns Readonly<A>.

    Type Parameters

    • A extends readonly unknown[]

      The readonly array or tuple type.

    A new readonly tuple type with the first element removed.

    type T1 = Tuple.Tail<[1, 2, 3]>; // readonly [2, 3]
    type T2 = Tuple.Tail<[1]>; // readonly []
    type T3 = Tuple.Tail<[]>; // readonly []
    type T4 = Tuple.Tail<readonly number[]>; // readonly number[]