1. For detailed articles, please see github.com/Advanced-Fr…

2. Brief summary:

The event loop is divided into macro task queue and micro task queue. The setTimeout callback function is placed in the macro task queue and executed after the execution stack is cleared. The callback function in promise.then will be placed in the microtask queue of the corresponding macro task until the synchronous code in the macro task completes execution. An async function means that there may be an asynchronous method inside a function, “await” followed by an expression. When an async method executes an “await”, it executes the expression immediately and then puts the code behind the expression in the microtask queue, leaving the execution stack for the synchronous code to execute first.