JavaScript String indexOf() method : The indexOf() method is used to return the index value of specified string. It will give the index of string comes first from the start. We can also start ...
The indexOf() method of {{jsxref("Array")}} instances returns the first index at which a given element can be found in the array, or -1 if it is not present.