Returns the last element of an array. When called with a non-empty tuple, the return type is T (not T | undefined).
T
T | undefined
The source array.
lastArrayItem([1, 2, 3]) // => 3lastArrayItem([]) // => undefined Copy
lastArrayItem([1, 2, 3]) // => 3lastArrayItem([]) // => undefined
Returns the last element of an array. When called with a non-empty tuple, the return type is
T(notT | undefined).