Lucee Function Reference

arraypop()

pops the last element from an array. In case the array is empty an exception is thrown,
         unless the second argument "defaultValue" is provided, in that case that value is returned.

Introduced: 5.3.8.104

Example

arraypop(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 Name of an array  
defaultValue any  No this value is returned in case the array is empty