Puzzle 14 of 15 · Microtasks
Trace synchronous logs, a resolved Promise callback and a zero-delay timer. Predict the output order across microtasks and timer tasks. Choose an output below, then check the explanation. No signup needed. Browse puzzles by topic →
1console.log("A"); 2setTimeout(() => console.log("B"), 0); 3Promise.resolve().then(() => console.log("C")); 4console.log("D");
Predict the console output. Each line is a separate log.
A B C D
A D B C
A C D B
A D C B