var a=10;
{
console.log(a);
let a =20 ;
}
ReferenceError: a is not defined
Why it is giving the reference error even a is declared using var which should have its scope inside the block too ?
var a=10;
{
console.log(a);
let a =20 ;
}
ReferenceError: a is not defined
Why it is giving the reference error even a is declared using var which should have its scope inside the block too ?