MCQs>IT & Programming>JavaScript>Values of x and y after the invocation of `foo` in following? var x = 'I am global x'; var y = 'I am global y'; function foo() { var y = x = 'Hello from foo'; } foo();
JavaScript MCQs
What are the values of x and y after the invocation of `foo` in following? var x = "I am global x"; var y = "I am global y"; function foo() { var y = x = "Hello from foo"; } foo();
Answer
Correct Answer: x = "Hello from foo"; y = "I am global y";
Explanation:
Note: This Question is unanswered, help us to find answer for this one