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
© 2012–present Foundeo, Inc. and the CFDocs contributors.
Licensed under the MIT License.
ColdFusion is a trademark of Adobe Systems Incorporated.
https://cfdocs.org/isarray