Write Your JavaScript Code Here
Run
Black
Copy Code
// indexOf(str)-It returns the index position of first character of string passed with method. // String.indexOf("str") let srt = "We've suffered losses, but we've not lost the war." console.log(srt.indexOf("war"));
Output: