inArray

public function inArray(a:Array, v:Object):Number/String
Returns the index of a value in an array, this method will return -1 if the item wasn't found.

Examples

// Get index of value in array this will alert 1 since 2 is at that index
alert(tinymce.inArray([1,2,3], 2));

Params

Name Type Description
a Array Array/Object to search for value in.
v Object Value to check for inside the array.

Returns

Number/String Index of item inside the array inside an object. Or -1 if it wasn't found.