indexOf() string method will search inside a string for a given value. If that value is found, it will return the position of its first occurrence. If that value isn't found, the
indexOf() method will return the value
var greeting = "Happy Birthday to Tom!"; var string_location = greeting.indexOf("Tom"); document.write(string_location);
This should print
18 to the screen.