21. implement LastItem<T>

TypeScript

  - 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]> // booleantype B = LastItem<['B', 'F', 'E']> // 'E'type C = LastItem<[]> // never

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