I want to know why the line a=21 does not change the global scope of A, but recreates a in the block scope
var a;
if(true) {
function a(){}
a = 21 // ?
console.log(a);
}
console.log(a);
I want to know why the line a=21 does not change the global scope of A, but recreates a in the block scope
var a;
if(true) {
function a(){}
a = 21 // ?
console.log(a);
}
console.log(a);