Why this behaves differently behave in the case of let and var
function foo() {
console.log(this.a);
console.log(this.b); // why it gives undefined
}
let b = 99;
var a = 66;
foo();
Why this behaves differently behave in the case of let and var
function foo() {
console.log(this.a);
console.log(this.b); // why it gives undefined
}
let b = 99;
var a = 66;
foo();