","answerCount":1,"datePublished":"2026-10-10T02:53:07.329Z","author":{"@type":"Organization","name":"PrimerPrep","url":"https://www.primerprep.in"},"acceptedAnswer":{"@type":"Answer","text":"Correct answer: True. This question has been retained as-is due to its unique context.","upvoteCount":1,"datePublished":"2026-10-10T02:53:07.329Z","author":{"@type":"Organization","name":"PrimerPrep","url":"https://www.primerprep.in"},"url":"https://www.primerprep.in/q/predict-the-output-of-the-following-javascript-code-html-hea#answer"}}}
Web Technology
primer-original-v2easyWeb TechnologyJavascriptprimer-original-v2

Predict the output of the following JavaScript code: <html> <head> <script> var txt= "pass 70% fail 30%"; var pattern = /\D/g; var res= txt.match(pattern); document.write(res); </script> </head> </html>

Answer options

A
True
B
False

Correct answer: True

Detailed Solution & Conceptual Analysis

This question has been retained as-is due to its unique context.

Key Engineering Takeaway

In Web Technology, understanding the underlying mechanics of Web Technology is critical for writing performant, bug-free production code and passing rigorous technical architecture reviews.

Related Web Technology questions

Practice more Web Technology questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.