ArrayAppend()
Appends an array element to an array.
ArrayAppend( array=array, value=any, merge=boolean );
Returns: Boolean
Examples
numbers = [ 1, 2, 3, 4 ];
ArrayAppend( numbers, 5 );
Dump( numbers ); // Outputs [ 1, 2, 3, 4, 5 ]
numbers = [ 1, 2, 3, 4 ];
moreNumbers = [ 5, 6, 7, 8 ];
ArrayAppend( numbers, moreNumbers );
Dump( numbers ); // Outputs [ 1, 2, 3, 4, [ 5, 6, 7, 8 ] ]
numbers = [ 1, 2, 3, 4 ];
moreNumbers = [ 5, 6, 7, 8 ];
ArrayAppend( numbers, moreNumbers, true );
Dump( numbers ); // Outputs [ 1, 2, 3, 4, 5, 6, 7, 8 ]
See also
- Arrays
- array.append()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)