Whatever message this page gives is out now! Go check it out!

ArrayPrepend

Last update:
May 18, 2026

Description

Inserts an array element at the beginning of an array.

Returns

The updated array.

Category

Function syntax

ArrayPrepend(array, value)

See also

Adding elements to an array in Basic array techniques in the Developing ColdFusion Applications

Parameters

Parameter
Description
array
Name of an array
value
Value to insert at beginning of array

Example

<cfscript>
    myArray = [3,2,1]; 
    arrayPrepend(myArray, 4);
    writeDump(myArray);
</cfscript>
Output

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page