This article is mainly to record an interview knowledge point, as well as read feel good related to the knowledge point article.
Macro and micro tasks
Macro-task includes:
- Script (whole code)
- setTimeout
- setInterval
- setImmediate
- I/O
- UI render
Micro-task includes:
- process.nextTick
- Promise
- Async/Await(actually promise)
- MutationObserver(new html5 feature)
Refer to the article
Interview question: Tell me about the event loop
Explain the Event Loop mechanism in JavaScript
The Event Loop mechanism in JavaScript