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

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy