-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
面试题整理 -- 1.JavaScript执行机制(单线程,通过Event Loop 事件循环执行异步) #17
Comments
1. task(macrotask)
task 源包括:(webappapis.html#generic-task-sources)
此外 setTimeout、setInterval、IndexDB 数据库操作等也是任务源。总结来说,常见的 task 任务有:
2. microtask每一个 eventloop 都有一个 microtask 队列。microtask 会排在 microtask 队列而非 task 队列中。 一般来说,microtask 包括:
3. 事件循环,宏任务,微任务的关系如图所示:4. 总结
|
一道面试题引发的血案,下面进入主题 |
上面问题更详细的说明: |
其实js stack如果不空的话,是不会调用微任务的, |
出处:
这一次,彻底弄懂 JavaScript 执行机制
The text was updated successfully, but these errors were encountered: