Arena Solutions Interview Question: What is different between a a... | Glassdoor

Interview Question

Senior Web Applications Engineer Interview Foster City, CA

What is different between a and b function foo() { a

  = 4; var b = 5; }
Answer

Interview Answer

3 Answers

0

The interviewer told me a is a global variable, b is the private variable only exist in function foo. However, I think he is wrong about the global variable a. You cannot access the variable a outside function foo.

Interview Candidate on Jul 10, 2015
2

http://www.w3schools.com/js/js_scope.asp

Interviewer on Jul 17, 2015
0

I am surprised that you even got an offer when you are demonstrating this kind of a knowledge in public.

Well wisher on Jul 17, 2015

Add Answers or Comments

To comment on this, Sign In or Sign Up.