Type Parameters
- S extends readonly unknown[]
Returns IfExtends<IsNonEmptyArray<S> extends true
? S[0]
: undefined | S[number], undefined | S[number], IsNonEmptyArray<S> extends true
? S[0]
: undefined | S[number], undefined | S[number]>
The first item of the array, or undefined
if the array is empty.
Returns the first item of an array.
See
at
Example