isArray

Determines whether a value is an array.
True, if value is an array, a query column object, or XML.
also number = Dimension; function tests whether the array has
exactly this dimension

isArray(value [, number]) → returns boolean

Argument Reference

value any
Required

The array in which to check.

number numeric

Dimension of the array.

Examples
Sample code invoking the isArray function

For CF 9+ CF 10+

colorArray = ['yellow','green','red'];
writeOutput(isArray(colorArray));

Expected Result: yes

For Lucee 4.5+

colorArray = ['yellow','green','red'];
writeOutput(isArray(colorArray));

Expected Result: true

For CF 9+ CF 10+

numberArray = [1,2,3];
writeOutput(isArray(numberArray,1));

Expected Result: yes

For Lucee 4.5+

numberArray = [1,2,3];
writeOutput(isArray(numberArray,1));

Expected Result: true

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub