The value of this is dictated by how and where a function is defined, but also by how it is invoked. In non-strict mode, the global context (the window object) becomes the function context. The speak method is invoked via its parent object anotherAverageJoe, which is rightly outputted as this value.

9m read timeFrom hackernoon.com
Post cover image
Table of contents
What exactly is "this"?Invoking functionsTaking a closer look at functionsThe curious case of arrow functionsConclusion
1 Impression3 Comments