Question 22 of 10022%
22
In a modern browser, in what order will these labels be logged? The snippet compares microtask APIs with timer APIs on the main thread.
console.log("sync");
setTimeout(() => console.log("timeout"), 0);
const id = setInterval(() => {
console.log("interval");
clearInterval(id);
}, 0);
Promise.resolve().then(() => console.log("promise"));
queueMicrotask(() => console.log("micro"));
console.log("sync2");
22/100