JavaScript Master · Game 2
Event Loop Express
Read the code, predict the console, then watch the real event loop run it. Every answer is checked against how JavaScript actually behaves.
Call stack●●●
01Warm-up
level-01.js
1console.log('A');2function greet() {3console.log('B');4}5greet();6console.log('C');
How the event loop decides
- 1. Run the code on the stackSync code runs line by line until the call stack is empty.
- 2. Drain every microtaskPromise callbacks, await and queueMicrotask. All of them, even new ones.
- 3. Take one task, repeatOne timer callback from the task queue, then back to rule 2.
Logs to place
Tap in the order they printYour console
0/3 · drag to reorder1>...
2>...
3>...
Keys: 1 to 3 place a log · Backspace undo · Enter run