The indexOf() method returns the position of a value in a string's first occurrence. If the value cannot be retrieved, the indexOf() method returns -1.