Skip to content

last

last(array)

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

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