Returns the last element of an array. Throws an error if the array is empty.
The type of elements in the array.
The array to get the last element from.
The last element of the array.
If the array is empty.
const numbers = [1, 2, 3, 4, 5];const lastNumber = arrLast(numbers);//=> 5 Copy
const numbers = [1, 2, 3, 4, 5];const lastNumber = arrLast(numbers);//=> 5
Generated using TypeDoc
Returns the last element of an array. Throws an error if the array is empty.