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