when a promise is ready, its .then/catch/finally handlers are put into the queue
When the JavaScript engine becomes free from the current code, it takes a task from the queue and executes it.
Promise handling is always asynchronous, as all promise actions pass through the internal “promise jobs” queue, also called “microtask queue” (V8 term). So .then/catch/finally handlers are always called after the current code is finished.
Promise handling is always asynchronous, as all promise actions pass through the internal “promise jobs” queue, also called “microtask queue” (V8 term). So .then/catch/finally handlers are always called after the current code is finished. If we need to guarantee that a piece of code is executed after .then/catch/finally, we can add it into a chai...
nternal queue PromiseJobs, more often referred to as the “microtask queue”
Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.