User Guide Cancel

ArrayIsEmpty

 

Description

Determines whether an array is empty of data elements.

Returns

True, if the array is empty; False, otherwise.

Category

Array functions

Function syntax

ArrayIsEmpty(array)

See also

ArrayIsDefinedarrayLenFunctions for XML object management in Modifying a ColdFusion XML object in the Developing ColdFusion Applications

History

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

Parameters

Parameter

Description

array

Name of an array

Usage

You can test whether an element of a higher level dimension of a multidimensional array is empty by specifying the element in the ArrayIsEmpty function. To test whether the first row of the two-dimensional array MyArray is empty, use the following function:

ArrayIsEmpty(MyArray2[1])

Example

<cfscript>
someArray = [1,2,3,4,5];
writeOutput(arrayIsEmpty(someArray)); // Returns False
</cfscript>
<cfscript> someArray = [1,2,3,4,5]; writeOutput(arrayIsEmpty(someArray)); // Returns False </cfscript>
<cfscript>
    someArray = [1,2,3,4,5];
    writeOutput(arrayIsEmpty(someArray)); // Returns False
</cfscript>

Get help faster and easier

New user?