Skip to main content

EC ↔ Environ to run JS, to contain VEST (Variable Environment, Scope Chain & this keyword), to fill task pipline in Call Stack

aka EC, Execution-Context

VEST

Variable Environment, Scope Chain & this keyword

VE

container for FAV (Function Declarations, Args Object & Variables )

Scope Chain

Link to Variable from outer Scopes to current Scope

_this_ keyword

Special variable which 👉to "owner" of calling function

Necessary info includes local Variables, Arguments

Global EC

EC created for Global Scope or Top-Level Code

Function EC

EC for Function Scope code

Runtime

final lifecyle stage when Program is run inside EC

Compile Time

Program lifecycle phase to Compile Source Code

ECs are stacked on top each other in Call Stack to keep track of order of execution

EC at top of stack is currently active running, and will then be popped off stack once finished

Execution Thread

Part of EC currently run in CPU Thread

Main Thread

Execution Thread for main App process inside CPU

References

  1. Call Stackwhere code executed via EC, to track execution order

  2. Args ObjectObject to contain all args pass into function (for current EC)

  3. Execution Thread ↔ Part of EC currently run in CPU Thread

  4. Global ECEC created for Global Scope or Top-Level Code

  5. Function ECEC for Function Scope code

  6. ClosureInternal Property of function to preserve access to VE of EC at its creation

  7. Runtime ↔ final lifecyle stage when Program is run inside EC

  8. MicrotaskCallback to defer fn after parent EC popped off Call Stack