Removes all elements from an array.
arrayClear(array)
→ returns boolean
someArray.clear()
Uses the arrayClear function to clear the value of an array
someArray = ["Red", "White", "Green", "Blue", "Pink"];
writeOutput(arrayClear(someArray));
Expected Result: Yes
Lucee 4.5+ To clear the value of an array
someArray = ["Red", "White", "Green", "Blue", "Pink"];
writeOutput(arrayClear(someArray));
Expected Result: true
CF 11+ Uses the member function is the same as running arrayClear.
numberArray = [1,2,3];
writeOutput(numberArray.Clear());
Expected Result: Yes
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.