The indexOf() method returns the position of the first occurrence of substring in string . The first position in the string is 0. If the indexOf() method does not find the substring in string, it will return -1.
The indexOf() method returns the position of the first occurrence of substring in string . The first position in the string is 0. If the indexOf() method does not find the substring in string, it will return -1.