10. The Global environment and the global object #

Created Sunday 20 February 2022

Global execution context #

this keyword #

The this keyword refers to the current execution context. In case of global code, this points (is equal) to window.

The 4 things for any location #

Every location in the code has 4 things associated/accessible with it:

  1. Global execution context (GEC). In the browser, this is window.
  2. Current execution context, referred by this.
  3. Outer environment (=null for the global execution context).
  4. The code in the current execution context.