♦ lastIndexOf() - String
♣ Example1: lastIndexOf()
Input:
xxxxxxxxxx
1
<script>
2
var str1 = "Hello World";
3
document.write(str1.lastIndexOf("orld"));
4
5
document.write("<br><br>");
6
7
var str2 = "Yo Folks";
8
document.write(str2.lastIndexOf("gas"));
9
10
document.write("<br><br>");
11
12
var str3 = "Good Day at Work";
13
document.write(str3.lastIndexOf("at"));
14
15
</script>
Output: