index

.index( element )

Searches the given element in this array, and returns the index it is found at. If it is not found, then null is returned.

names = [ 'Jenna', 'Ming' ]

index = names.index( 'Jenna' ) // set to 1
index = names.index( 'Moses' ) // set to null

See also

indexes