The JavaScript indexOf method

The indexOf method is used to search in arrays. You have to specify an element to be found in the given array and indexOf method will return its index in the array if that array contains the given element. If given search element does not exist in the array the indexOf method will return -1 value.