19. implement FirstItem<T>

TypeScript
Is this helpful ?

  - accepted / - tried

Similar to 16. FirstChar<T>, please implement FirstItem<T> to obtain first item of a tuple type.

type A = FirstItem<[string, number, boolean]> // string
type B = FirstItem<['B', 'F', 'E']> // 'B'

Let's try to solve this problem within 5 minutes.

Discuss(9)