IsArray
Determine whether a value is an array
Method Signature
IsArray(value=[any], number=[numeric])
Arguments
Argument
Type
Required
Description
Default
value
any
true
The value to test for array-ness.
number
numeric
false
If passed, the array dimension to test.
Examples
simple isArray example
colorArray = [
"yellow",
"green",
"red"
];
writeOutput( isArray( colorArray ) );
Result: yes
simple isArray example
colorArray = [
"yellow",
"green",
"red"
];
writeOutput( isArray( colorArray ) );
Result: true
isArray example with number
numberArray = [
1,
2,
3
];
writeOutput( isArray( numberArray, 1 ) );
Result: yes
isArray example with number
numberArray = [
1,
2,
3
];
writeOutput( isArray( numberArray, 1 ) );
Result: true
Additional Examples
writeDump( label="Empty Array", var=isArray( [] ) );
writeDump( label="ArrayNew", var=isArray( arrayNew( 1 ) ) );
writeDump( label="ArrayNew position3", var=isArray( arrayNew( 3 ), 3 ) );
writeDump( label="Boolean value", var=isArray( true ) );
writeDump( label="String value", var=isArray( "array" ) );
Related
Last updated
Was this helpful?