Interview Preparation Coding Interview Objective
May 09, 2013

What is the output of bellow JavaScript code?
<script type="text/javascript">
function x()
{
var s= "Good 100%";
var pattern = /\D/g;
var output= s.match(pattern);
document.write(output);
}
</script>

Choose the correct answer:
A) G,o,o,d,%
B) Good %
C) 1,0,0
D) Error
Detailed Explanation

Option A is the right Answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback