these two are learning the relevant syntax of ES6. When I learned about the this problem of the arrow function, when I compared it with the this in ES5, I found that the following line of code got incredible results:
var age = 77;
function foo() {
var age = 18;
setTimeout(function () {
console.log(this.age);//undefined
},3000)
}
foo();
is there a big boss who knows the problem? My understanding is that this should output 77. But undefined is output here