first
ts
function Array.first<T>(target: readonly T[]): T | undefinedReturns the first element of array, or undefined if the array is empty.
Example
ts
import { Array } from "@monstermann/array";
Array.first([1, 2, 3, 4]); // 1ts
import { Array } from "@monstermann/array";
pipe([1, 2, 3, 4], Array.first()); // 1