Lucee Function Reference

Function ARRAYPREPEND

Inserts an array element at the beginning of an array
and shifts the positions of the existing elements to
make room.

Example

arrayprepend(array array,any value,[boolean merge]):boolean

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  
value any  Yes value to prepend  
merge boolean  No This argument only applies when the value is an array.
If set to true prepend array elements individually to the source array.
If false (default) the complete array is added as one element at the top, in the source array.