21. implement LastItem<T>

TypeScript
Is this helpful ?

from all members: - accepted / - tried

Similar to 19. FirstItem<T>, please implement LastItem<T> to obtain last item of a tuple type.

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

Let's try to solve this problem within 10 mintues.

Discuss(5)