Inserts an array element at the beginning of an array.
The updated array.
ArrayPrepend(array, value) |
Adding elements to an array in Basic array techniques in the Developing ColdFusion Applications
Parameter |
Description |
|---|---|
array |
Name of an array |
value |
Value to insert at beginning of array |

<cfscript>
myArray = [3,2,1];
arrayPrepend(myArray, 4);
writeDump(myArray);
</cfscript>
Output
Sign in to your account