Javascript IndexOf() Function

The indexof() function of array object returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found. Use it for example to find element in the array.

Syntax

Javascript IndexOf() Function Example1

Javascript IndexOf() Function Example2