head (Functional Programming) es-toolkit
Creates a function that returns the first value of an array. Use it with pipe.
Info
Usage
head returns the first value in the piped array. If the array is empty, it returns undefined.
Parameters
This function takes no arguments; call it as head().
Returns
A function that maps a readonly T[] to its first value.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.