ArrayShift()
Removes the first element of an array and returns the element that is removed. This method removes the element at the first index and shifts the values at consecutive indexes down. If you use ArrayShift in an empty array, you get an exception.
Introduced: 5.3.8.104
ArrayShift( array=array, defaultValue=any );
Returns: any
Argument | Description |
---|---|
array, required |
The array to shift. |
any, optional |
this value is returned in case the array is empty |
Examples
See also
- Arrays
- array.shift()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)