List.Last
List.Last(list as list, optional defaultValue as any) as any
Returns the last item in the list list
, or the optional default value, defaultValue
, if the list is empty. If the list is empty and a default value is not specified, the function returns null
.
Find the last value in the list {1, 2, 3}.
Usage
List.Last({1, 2, 3})
Output
3
Find the last value in the list {} or -1 if it empty.
Usage
List.Last({}, -1)
Output
-1