← Quiz: Async JavaScript: all 10 questions
Quiz: Async JavaScript · Question 6 of 10
What does this print? (code)
What does this print?
console.log(1);
setTimeout(() => console.log(2), 0);
console.log(3);
- A.1 2 3
- B.1 3 2
- C.2 1 3
- D.1 3
Answer & explanation
Correct answer: 1 3 2
A timer callback waits until the current code finishes, even with a 0 ms delay.
Can you get the rest right without peeking?
Take the timed Quiz: Async JavaScript quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →