This is not a duplicate, please do not close it again.
I went through What does "this" refer to in arrow functions in ES6? but didn't find an answer.
class A{
static myf(test){
console.log(this); //when A.myf executes, logs 'A'
test();
}
}
A.myf(()=>{
console.log(this); // logs 'window'
})
Could someone help me with this? In the case above, the arrow function's lexical environment is A.myf, and 'this' of the arrow function should inherit from 'this' of myf. so why logs 'window' instead of A?