Episode 1: How JavaScript Works!
Execution Context
- Everything in JavaScript happens inside the execution context.
- The execution context is like a big box or container where the JavaScript code is executed.
- It consists of two components: the memory component (variable environment) and the code component (thread of execution).
Memory Component (Variable Environment)
- Variables and functions are stored in the memory component as key-value pairs.
- The memory component is also known as the variable environment.
Code Component (Thread of Execution)
- The code component is where the JavaScript code is executed line by line.
- It is also known as the thread of execution.
JavaScript Characteristics
- JavaScript is a synchronous single-threaded language.
- Synchronous: It executes one command at a time in a specific order.
- Single-threaded: It can only execute one command at a time.
- It proceeds to the next line only when the current line has finished executing.
Watch Live On Youtube below: