Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.02 KB

File metadata and controls

34 lines (21 loc) · 1.02 KB

CHAPTER 04: Execution Context

Everything in JS happens inside the execution context.

Assume execution context to be a big box / container where everything takes place(whole javascript code is executed).

It has 2 components in it:

  • Memory: The place where all the variables and functions are stored as (key:value) pairs. Memory component is also known as variable environment.
  • Code: The place where code is executed one line at a time. Code component is also known as Thread of Execution

NOTE: Javascript is not possible without this beautiful execution context.

JS is a synchronous single-threaded language.

  • By single threaded, we mean JS can only run 1 command at a time
  • By synchronous single threaded, we mean it can run 1 command at a time, in a specific order



‹ GO TO PREVIOUS

GO TO NEXT ›