never fully understood lexical scoping in context of arrow functions and normal functions
this.thisGlobalVariable = 200;
function normalFunction() {
this.thisVariable = 100;
}
function normalFunctionTwo() {
console.log(this.thisVariable); // 100
console.log(this.globalVariable); // undefined
}
let anonymousArrowFunction = () => {
console.log(this.thisVariable); // undefined
console.log(this.thisGlobalVariable); // 200
}
normalFunctionTwo();
anonymousArrowFunction();
so since anonymousArrowFunction is an arrow function, it's lexical (its scope is the context in which it was created in) here, it'd be the global scope as it's able to access this.thisGlobalVariable? whereas normalFunction and normalFunctionTwo as normal functions would create its own this, in its own scope? how is normalFunctionTwo able to access this.thisVariable that was defined in normalFunction?