Skip to content

head

head<A>(data): Option<A>

Defined in: Core/Arr.ts:33

Returns the first element of an array, or None if the array is empty.

A

readonly A[]

Option<A>

Arr.head([1, 2, 3]); // Some(1)
Arr.head([]); // None