ArrayClear()
Removes all elements from an array.
ArrayClear( array=array );
Returns: Boolean
| Argument | Description |
|---|---|
|
array
array,
required
|
edit
Name of an array |
Examples
edit// Creates an array containing 4 elements with the numbers 1 - 4.
numbers = [ 1, 2, 3, 4 ];
dump( numbers ); // outputs the array containing 1 - 4
// Clears the array leaving an array with 0 elements.
ArrayClear( numbers );
dump( numbers ); // outputs the empty array
See also
- Arrays
- array.clear()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)