PokéRogue
    Preparing search index...

    Type Alias LastOfUnion<T>

    LastOfUnion: UnionToIntersection<T extends any ? () => T : never> extends () => infer R
        ? R
        : never

    Returns the last element of a union type.

    Type Parameters

    • T
    type Last = LastOfUnion<1 | 2 | 3>;
    //=> 3