@tempots/std
arrayHead() function
Returns the first element of an array, or undefined
if the array is empty.
Signature:
arrayHead: (arr: A[]) => Maybe
Parameters
Parameter |
Type |
Description |
---|---|---|
arr |
A[] |
The input array. |
Returns: Maybe
The first element of the array, or undefined
if the array is empty.