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