← Quiz: Async JavaScript: all 10 questions
Quiz: Async JavaScript · Question 1 of 10
In what order does this print the letters? (code)
In what order does this print the letters?
setTimeout(() => console.log("A"), 0);
Promise.resolve().then(() => console.log("B"));
console.log("C");
- A.C B A
- B.A B C
- C.C A B
- D.B C A
Answer & explanation
Correct answer: C B A
Order: C (synchronous code), B (promise microtask), A (timer task).
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 →