Write Your JavaScript Code Here

// indexOf("ch",index):-It start searching the element from the provided index value and then returns the index position of specified char value. // String.indexOf("ch",index) let srt = "You must protect the planet. If the Decepticons find it, then our people are truly finished." console.log(srt.indexOf("p",11)); console.log(srt.indexOf("must" ,5));//here it print -1 because char/string is not present in the String

Output: