Multiple choice javascript

Which method is used to search for a substring ?

  1. stringVariable.substring(subString)

  2. stringVariable.find(subString)

  3. stringVariable.indexOf(subString)

  4. stringVariable.indexOf(charAt(0))

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The indexOf() method returns the position of the first occurrence of a specified value in a string, effectively searching for the substring. substring() extracts characters, and find() is not a standard JavaScript String method.