ArrayPrepend()
Inserts an array element at the beginning of an array and shifts the positions of the existing elements to make room.
ArrayPrepend( array=array, value=any, merge=boolean );
Returns: Boolean
Examples
Add an array item on to the front of an array
someArray = [3,2,1];
arrayPrepend(someArray, 4);
dump(someArray);
// member function
doctorWhoArray = ['Whittaker','Tennant','Baker'];
doctorWhoArray.prepend('Hurt');
dump(doctorWhoArray);
See also
- Arrays
- array.prepend()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)