pops the first element from an array and shift the rest of the values to the left. In case the array is empty an exception is thrown,
unless the second argument "defaultValue" is provided, in that case that value is returned.
Lucee Function Reference
arrayshift()
Introduced: 5.3.8.104
Example
arrayshift(array array,[any defaultValue]):any
Category
array
Arguments
The arguments for this function are set. You can not use other arguments except the following ones.
Name | Type | Required | Description |
---|---|---|---|
array | array | Yes | array to shift |
defaultValue | any | No | this value is returned in case the array is empty |