type-challenges/questions/10-medium-tuple-to-union
2020-07-31 17:50:09 +08:00
..
2020-07-26 09:25:03 +08:00
2020-07-26 09:25:03 +08:00
2020-07-31 17:50:09 +08:00
2020-07-26 09:25:03 +08:00
2020-07-26 09:25:03 +08:00

Tuple to Union medium #infer #tuple #union

by Anthony Fu @antfu

Take the Challenge

Implement a generic TupleToUnion<T> which covers the values of a tuple to its values union.

For example

type Arr = ['1', '2', '3']

const a: TupleToUnion<Arr> // expected to be '1' | '2' | '3'

Back Share your Solutions Check out Solutions