-
Notifications
You must be signed in to change notification settings - Fork 1
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
微任务/宏任务 执行顺序 event loop #12
Labels
Comments
找到合理的解释了 new Promise((resolve,reject)=>{
console.log("1")
resolve();
}).then(()=>{
// 外部第1个then
console.log("2")
new Promise((resolve,reject)=>{
console.log("3")
resolve();
}).then(()=>{
// 内部第1个then
console.log("4")
}).then(() => {
// 内部第2个then
console.log("5")
})
}).then((res)=>{
// 外部第2个then
console.log("6")
}) 简单来讲就是 拿上面的代码来讲,当外部第1个then里的 整理一下: ps: 如果将外部第1个then里的 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
想问一下这个执行输出为什么6在5之前?
The text was updated successfully, but these errors were encountered: