The JavaScript array indexOf() method is used to search the position of a particular element in a given array. This method is case-sensitive.
The index position of first element in an array is always start with zero. If an element is not present in an array, it returns -1.
array.indexOf(item, start)
Paramaters: This method accepts two parameters as mentioned above and described below:
var fruits = ["Banana", "Orange", "Apple", "Mango", "Banana", "Orange", "Apple"];
var a = fruits.indexOf("Apple", 4);