ArrayIsDefined()

Returns whether there exists an item in the array at the selected index.

ArrayIsDefined( array=array, index=number );

Returns: Boolean

Argument Description
array
array, required

The array to search

index
number, required

The index which to check

Examples

Check to see if an index is defined at a given position

fruitArray = ['apple', 'kiwi', 'banana', 'orange', 'mango', 'kiwi'];

dump(arrayIsDefined(fruitArray,3)); //true

//member function dump(fruitArray.isDefined(30)); //false

See also