Q. What will be the output of following JavaScript code?
Code:
<script type="text/javascript">
var a="Tanmay";
var x=a.lastIndexOf("a");
document.write(x);
</script>
β
Correct Answer: (A)
4