Last element
Syntax
$set.lastElement()
$set[$set.size() - 1]
Description
Returns the last element of the set.
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
set | Set | A set from which the last element should be returned. | yes |
Return value
Type: number/string/boolean/businss object/set
The last element from set
or null
, if the set is empty.
Examples
Filled list
list("hello", "how", "are", "you").lastElement()
Output: you
Empty list
list().lastElement()
Output: null