indexOf() method returns the first index at which a given element can be found in the array.
syntax ↴
indexOf(element, start) ↴
element element to locate in the array.
start (optional). Where to start the search in the array.
Negative start index counts back from the end of the array.
indexOf() method returns the first index at which a given element can be found in the array.
indexOf() method returns -1 if the value is not found.
indexOf() method does not change the original array.
indexOf() method is case-sensitive.
myArray.indexOf(element)
myArray.indexOf(element, start)