Learning on Web Dev Open is free for all.

ArcadeEvent Loop
Arcade

Event Loop

Phase 03 · Systems ThinkingPlayable

Order the log lines before the microtasks, timers and paints run.

SnippetJust the stack
console.log('A');

function greet() {
  console.log('B');
}

greet();
console.log('C');
Console0 / 3
  1. Click the lines below in the order they print.
Unplaced
Level 1 of 6Unsubmitted

No queues involved. Order the three lines.

Place 3 more lines.

Tick by tickLocked until submit

Submit an order first. The walkthrough shows both queues after every tick, right or wrong.

Run

Synchronous code runs to completion on the call stack. The event loop is not consulted at all until the stack is empty.