Question d’entretien chez Arena Solutions

What is different between a and b function foo() { a = 4; var b = 5; }

Réponses aux questions d'entretien

Utilisateur anonyme

10 juil. 2015

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.

1

Utilisateur anonyme

17 juil. 2015

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