MCQs > IT & Programming > JavaScript > Analyze the code using the source property of Regular Expressions. What's the output?

JavaScript MCQs

Analyze the following code using the source property of Regular Expressions. What will be the output of the below code snippet?

<html>
<body>
<script type="text/javascript">
var str = "Visit Garden\Showcase";
var patt1 = new RegExp("en\S","g");
document.write("The regular expression is: " + patt1.source);
</script>
</body>
</html>


Answer

Correct Answer: The regular expression is: enS

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