I have this piece of code
var c=9;
function cb(){
console.log(c); // it prints undefined
var c=0;
}
cb();
var c=9;
{
console.log(c); // it prints 9
var c=0;
}
So if I am not wrong does the var gets hoisted to the global execution context ??