Returns the first 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.
firstArrayItem([1, 2, 3]) // => 1firstArrayItem([]) // => undefined Copy
firstArrayItem([1, 2, 3]) // => 1firstArrayItem([]) // => undefined
Returns the first element of an array. When called with a non-empty tuple, the return type is
T(notT | undefined).