In ES5, this refers to the top-level object ( window in the browser) In strict mode, this behaves differently, as undefined. The first argument is undefined or null, which in non-strict mode points to window. In strict modes, it refers to a primitive value, which is a wrapped value and will not be an object.
Table of contents
8 Different Places “this” Can Point to in JavaScript1. Global context2. Function context3. Object function (method) invocation pattern4. call(), apply(), bind()5. Constructor call pattern6. Calling Patterns in the Prototype Chain7. Arrow function call pattern8. DOM event handler function callUnlock 10x development with independent componentsSort: