Returns the last item from an array. Throws an error if the array is empty.
arrayLast(array)
returns any
array.last()
Name | Type | Required | Default | Description |
---|---|---|---|---|
array | array | Yes |
Uses the arrayLast function to retrieve the last element of an array
someArray = ["first", "second", "third"];
lastOne=arrayLast(someArray);
writeOutput(lastOne);