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

Run Example

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

Result: yes

simple isArray example

Run Example

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

Result: true

isArray example with number

Run Example

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

Result: yes

isArray example with number

Run Example

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

Result: true

Additional Examples

Run Example

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" ) );

Last updated

Was this helpful?