I watched a video on javascript objects that said that before the browser interprets the java script code, it actually includes a quick compilation step (well, not really “compilation”, so to speak, since it does not involve creating an intermediate file), which registers the declaration of variables and functions in their respective field. Therefore, if I write:
var a = 3;
function foo(){
var c = 2;
}
Before evaluating the above expression, which means ignoring the RHS part, the variable 'a' and the function 'foo' will be registered in the global scope and inside the scope of 'foo', the variable 'c' will be registered. After this stage of compilation, the expressions will be evaluated by their values.
But what happens when we write:
var a = function(){
var c;
}
'a' c, R.H.S. ?