Skip to content

first

first(array)

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

ts
first([1, 2, 3, 4]); // 1
ts
pipe([1, 2, 3, 4], first()); // 1