Description

Deletes the data in an array.

Returns

An empty array.

Syntax

ArrayClear(array)

Parameters

Parameter

Description

array

Name of an array

History

ColdFusion (2018 release): Returns an empty array.

ColdFusion MX: Changed behavior: This function can be used on XML objects.

Category

See also

Example

<cfscript>
       myArray=[1,2,3,4,5];
       // Clear myArray
       WriteOutput(ArrayClear(myArray)); // Clears the array and returns True
       WriteDump(myArray); // Returns an empty array
</cfscript>

Output

YES