Skip to content
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

区别 #566

Open
DanielLin0516 opened this issue Mar 12, 2022 · 0 comments
Open

区别 #566

DanielLin0516 opened this issue Mar 12, 2022 · 0 comments

Comments

@DanielLin0516
Copy link

setTimeout是一个宏任务
Promise是个异步任务,防止回调地狱,写法更具观赏性
async await 是根据generator的一个语法糖(很多人误以为是promise的语法糖),我们利用async await可以更好的用同步代码编写异步任务

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant