Static utility methods for Arrays.
public static function contains(arr:Array, element:*):Boolean
Checks whether the Array contains the specified element.
Parameters
| arr:Array — the Array to examine
|
| |
| element:* — the element to look for
|
Returns
| Boolean — true if the Array contains the specified element
|
public static function indexOf(arr:Array, element:*):int
Returns the index of the first occurence of the specified element in the Array or -1 if the
Array does not contain that element.
Parameters
| arr:Array — the Array to examine
|
| |
| element:* — the element to return the index for
|
Returns
| int — the zero-based index of the first occurence of the specified element or -1 if the
Array does not contain that element
|
public static function lastIndexOf(arr:Array, element:*):int
Returns the index of the last occurence of the specified element in the Array or -1 if the
Array does not contain that element.
Parameters
| arr:Array — the Array to examine
|
| |
| element:* — the element to return the index for
|
Returns
| int — the zero-based index of the last occurence of the specified element or -1 if the
Array does not contain that element
|
public static function remove(arr:Array, element:*):Boolean
Removes the specified instance from the Array.
Parameters
| arr:Array — the Array to remove the element from
|
| |
| element:* — the element to remove
|
Returns
| Boolean — true if the Array contained the specified element
|