Javascript indexOf() Reference

Description:
Returns first occurrence of string, or -1 if not found.

Syntax:

string.indexOf(searchvalue,start)

Examples:

var str = "Welcome to heck.";
var position = str.indexOf("e");
console.log(position); // 1
var str = "My name is Kiiddddd!";
var position = str.indexOf("e", 5);
console.log(position); // 6
var str = "Hello world";
var position = str.indexOf("z");
console.log(position); // -1