MCQs>IT & Programming>JavaScript>for the following code: var baz = 0; function foo() { alert(bar(baz)); var baz = 1; function bar(message) { return message + ' is ' + message + '!' } baz = 2 alert(bar(baz)); } foo(); What gets alerted?
JavaScript MCQs
for the following code: var baz = 0; function foo() { alert(bar(baz)); var baz = 1; function bar(message) { return message + ' is ' + message + '!'; } baz = 2 alert(bar(baz)); } foo(); What gets alerted?
Answer
Correct Answer: undefined is undefined! 2 is 2!
Explanation:
Note: This Question is unanswered, help us to find answer for this one