<!DOCTYPE html>
<html lang="en-US">
<body>
<script>
var myFruit = ["Apple", "Banana", "Cherry", "Apple"];
//["Apple", "Banana", "Cherry", "Apple"];
document.write("Last Index of Apple is - "+myFruit.lastIndexOf("Apple"));
//["Apple"];
document.write("<br>Last Index of Apple is - "+myFruit.lastIndexOf("Apple", 0));
//["Apple", "Banana", "Cherry"];
document.write("<br>Last Index of Apple is - "+myFruit.lastIndexOf("Apple", 2));
</script> </body>
</html>