","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Correct answer: p,a,s,s, ,%, ,f,a,i,l, ,%. The correct answer is: p,a,s,s, ,%, ,f,a,i,l, ,%.","upvoteCount":1,"url":"https://www.primerprep.in/q/predict-the-output-of-the-following-javascript-code-var-txt-pass-70#answer"}}}
Essentials
Accenture Technical PrimermediumEssentialsWeb Technologies

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
p,a,s,s, ,%, ,f,a,i,l, ,%
B
JavaScript
C
HTML5
D
innerHTML

Correct answer: p,a,s,s, ,%, ,f,a,i,l, ,%

Explanation

Quick AnswerThe correct answer is p,a,s,s, ,%, ,f,a,i,l, ,% because it directly addresses the core logic of Essentials.

The correct answer is: p,a,s,s, ,%, ,f,a,i,l, ,%.

Related Accenture Essentials questions

Practice more Accenture Essentials questions

PrimerPrep has 1400+ practice questions, 2026 simulations and coding hands-on — all free.

Watch Walkthroughs!