MCQs > IT & Programming > JavaScript > What's the output?

JavaScript MCQs

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>

Answer

Correct Answer: rose found. index now at: 8

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it