frontend trainer

Event Loop Trainer

Solve event loop puzzles together: choose a scenario and observe the call stack, Web API, and queues.

← Back to trainers

Scenario

Synchronous code only

The simplest case — only synchronous operations without any asynchronous code.

index.js
JavaScript
1console.log(1); 2console.log(2); 3console.log(3); 4

Step 1 of 5

Global context starts

The engine creates a global execution context and places the script in the Call Stack.

Call Stack
LIFO
global()top
Web API
Browser
No active tasks
Task Queue
Macro
Queue is empty
Job Queue
Micro
Queue is empty
Console
stdout
Console is empty for now