Analyze the following code snippet. What will be the output of this code?
<html>
<body>
<script type="text/javascript">
var str = "The rose";
var patt1 = new RegExp("rose", "g");
patt1.test(str);
document.write("rose found. index now at: " + patt1.lastIndex);
</script>
</body>
</html>
Correct Answer: rose found. index now at: 8
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More JavaScript MCQ Questions
JavaScript MCQs | Topic-wise