CodePeek
Practice / AsyncBack to CodePeek

JavaScript Timers: Zero is not now

Puzzle 13 of 15 · Timers

Follow synchronous console logs around a zero-delay setTimeout. Predict the order in which the logs appear. Choose an output below, then check the explanation. No signup needed. Browse puzzles by topic →

Async / TimersJavaScript
console.log("A");
setTimeout(() => console.log("B"), 0);
console.log("C");

Predict the console output. Each line is a separate log.

What’s the output?

Choose the output

Starter puzzles 15