Array Attributes

first

This attribute returns the first element of an array. The datatype of the attribute depends on the data type of the array on which it is applied. For example, the first element of a String array will always be a String.

Returns


  • the first element of the array, or null if the array is empty.

Example

array as String[]= ["Hello","World","!!!"]
display array.first
The expected result is "Hello".

last

This attribute returns the last element of an array. As with first, the datatype of the attribute depends on the data type of the array on which it is applied.

Returns


  • the last element of the array, or null if the array is empty.

Example

array as String[]= ["Hello","World","!!!"]
display array.last
The expected result is "!!!".