ArrayFirst()
Returns the first item from an array. Throws an error if the array is empty.
ArrayFirst( array=array );
Returns: any
| Argument | Description |
|---|---|
|
array
array,
required
|
edit
The array to obtain the first Item from |
Examples
editaNames = array("Marcus","Sarah","Josefine");
dump( var=aNames, label="aNames - original array" );
dump(var=arrayFirst(aNames),label="first element of array aNames");
See also
- Arrays
- array.first()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)