Last of Array medium #array #4.0

by Anthony Fu @antfu

Take the Challenge

> TypeScript 4.0 is recommended in this challenge Implement a generic `Last` that takes an Array `T` and returns it's last element's type. For example ```ts type arr1 = ['a', 'b', 'c'] type arr2 = [3, 2, 1] type tail1 = Last // expected to be 'c' type tail2 = Last // expected to be 1 ```
Back Share your Solutions Check out Solutions

Related Challenges

14・First of Array 16・Pop