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

isArray Argument Reference

value any
Required

The array in which to check.

number numeric

Dimension of the array.

Examples sample code invoking the isArray function


simple isArray example

For CF 9+ CF 10+

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

Expected Result: yes


simple isArray example

For Lucee 4.5+

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

Expected Result: true


isArray example with number

For CF 9+ CF 10+

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

Expected Result: yes


isArray example with number

For Lucee 4.5+

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

Expected Result: true


Fork me on GitHub