IsUnion

@typehero
Last updated 5 months ago
MEDIUM

Implement a type IsUnion, which takes an input type T and returns whether T resolves to a union type.

For example:

type case1 = IsUnion<string> // false type case2 = IsUnion<string | number> // true type case3 = IsUnion<[string | number]> // false

This challenge was ported from Type Challenges and was authored by bencor

More Challenges

Loading...
Loading...