Chapter XII · Execution Context
Execution Phase
The execution phase is the stage where the JavaScript engine steps through code line-by-line, assigning values and running statements.
01 How It Works
Think of executing checklist tasks sequentially during an active live operation.
Variables are assigned their concrete values, expressions are evaluated, and function calls are triggered sequentially.
example.js
let x = 10;
let y = 20;
let sum = x + y; // Values assigned and computed here
1. Creation phase completes setting up memory bindings.
2. Engine executes code line-by-line from top to bottom.
3. Variables receive assigned values and operations execute.
02 Practical Example
Here is how you might see this concept applied in real-world code:
practical.js
let score = 0;
score = 100; // Value assigned during execution phase
console.log(score);
Key Takeaway
Code values are assigned and processed sequentially during the execution phase.