This code keeps the context in window:
const a = function () {
console.log(this);} //window
And this code changes the context to a2:
const a3 = {
anyFunction: () => { console.log(this) } // window
}
a3.anyFunction();
Why this code keeps the context in window? how does the call stack works with anonymous functions that makes the context stay the same as if the function was not in the context of a4?
const a4 = {
anyFunction: () => console.log(this) // window
}
a4.anyFunction();