🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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");
  1. A.C B A
  2. B.A B C
  3. C.C A B
  4. 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 →