JS & TS Drills · Lesson 1 of 4Async JavaScript8 min

Tasks and microtasks

Read this as one browser script. What order appears in the console?

example.jsJavaScript
console.log("A");
setTimeout(() => console.log("B"), 0);
Promise.resolve()
  .then(() => console.log("C"));
console.log("D");

Focus mode