Thank for this very nice article. I've learned a lot from this.
But I have a thing to contribute that is the** (macro)task** queue is high priority than microtask queue. Following your example in . The reason of the setTimeout ran after Promise is it was sent to the (macro)task queue and execute in the next iteration (Tasks added to the queue after the iteration begins will not run until the next iteration.). It is different with microtask queue when execution of microtasks continues until the queue is empty—even if new ones are scheduled in the interim.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank for this very nice article. I've learned a lot from this.
But I have a thing to contribute that is the** (macro)task** queue is high priority than microtask queue. Following your example in . The reason of the setTimeout ran after Promise is it was sent to the (macro)task queue and execute in the next iteration (Tasks added to the queue after the iteration begins will not run until the next iteration.). It is different with microtask queue when execution of microtasks continues until the queue is empty—even if new ones are scheduled in the interim.