Appearance
Array.lastOrThrow(array)
Returns the last element of array, or throws an error if the array is empty.
array
import { Array } from "@monstermann/array"; Array.lastOrThrow([1, 2, 3, 4]); // 4
import { Array } from "@monstermann/array"; pipe([1, 2, 3, 4], Array.lastOrThrow()); // 4