All 13

See how JavaScript actually runs.

Predict the console output, then trace callbacks, scopes and bindings step by step — Call Stack, queues, and the environments your closures capture.

interview.jsrunning
1console.log('A');
3setTimeout(() => console.log('B'), 0);
5Promise.resolve().then(() => console.log('C'));
7console.log('D');
Microtask Queue0
empty
Task Queue0
empty
Console
>A
>
>
>
Sync code runs first

13 cases · 17 experiments · outputs verified on every commit

The series

Thirteen snippets developers get wrong — each one naming the exact misconception when you do.

Async JavaScript

Microtasks, chains, await, and the network.

START HERE ~8 min

How Promises Run

Promise vs setTimeout

The classic interview question. setTimeout is registered BEFORE the promise — so why does the promise callback run first? Watch the two queues to find out.

22 steps Start →
Intermediate ~8 min

How Promise Chains Run

Two chains, interleaved

Two promise chains, written one after the other. They do not run one after the other — they interleave, step for step. The reason is a single rule about when a chained .then() is queued.

29 steps Start →
Advanced ~8 min

How await Runs

async / await

async/await is syntactic sugar over promises. See the exact moment main() suspends, where its continuation waits, and why the global script keeps running.

19 steps Start →
Intermediate ~8 min

How Rejections Run

throw · catch · finally

Nine cases in, everything so far has succeeded. This one throws. Where does the error go, when does catch actually run — and what happens if nobody catches at all?

19 steps Start →
Intermediate ~8 min

How Promise.all Runs

fail-fast, but nothing gets cancelled

Promise.all rejects the moment one input rejects. So what happens to the other promises — do they stop? Watch the slow timer to find out.

23 steps Start →
Intermediate ~9 min

How fetch Runs

await over the network

A request takes 200ms and JavaScript is single-threaded. So what is the thread doing meanwhile, why are there TWO awaits, and why does a 404 sail straight past your catch block?

28 steps Start →

Every output here is executed, not asserted.

A script runs each snippet for real on every commit and checks the result against the animation and the answer key. If they disagree, the build fails.

How this is verified →