Loading topic
Promise.resolve().then(...) and setTimeout. Here we add the second queue the engine uses, the microtask queue. You will see when it 6 min readthen and catch, and that you have read the previous chapter on the microtask queue. That chapter showed that the microtask queue is drained completely after each task. This chapter covers which promise operations add jobs to that queue, at w5 min read.then callbacks are queued as microtasks, which the previous chapter covered. You should also be comfortable writing basic async functions. Here you will see what the engine actually does when it meets async and await. Once you have t5 min readqueueMicrotask, the direct API for scheduling a microtask, and MutationObserver, the DOM 6 min readasync/await schedule work. This chapter puts those pieces together into a repeatable method for predicting what a snippet of mixed asynchronous code prints. It assumes you know closures, callbac5 min readsetTimeout. Here we add the piece browsers put on top of that model, which is the step where the pag5 min readprocess.nextTick and setImmediate. Their 5 min readasync/await. It also assumes you know where rendering sits in the browser loop and how Node.js splits 5 min readasync/await. Here the question shifts from diagnosis to repair. When you have a large amount o5 min read