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

Promise 链 章节 补充表述的建议 #1218

Open
akfc58 opened this issue Aug 7, 2024 · 0 comments
Open

Promise 链 章节 补充表述的建议 #1218

akfc58 opened this issue Aug 7, 2024 · 0 comments

Comments

@akfc58
Copy link

akfc58 commented Aug 7, 2024

位置:
https://zh.javascript.info/promise-chaining#shi-li-loadscript

问题:
1.没有说清楚:在最后一个then中(无论是第一种promise chain情况,还是第二种嵌套then的情况),为什么能访问one、two、three
2.没有说清楚:在promise chain中,最后一个then中不能访问每个script变量(我觉得,可能不对);嵌套then可以访问变量 script1,script2 和 script3,但诚如文章所说,这是个例外,而不是规则。

建议:
1.说明为什么能访问one two three函数:脚本被加载后,这些函数成为全局函数。promise chain保证的是它们加载完成再才被调用。
2.说明promise chain中,传递的script参数的作用(我觉得,文章例子中,script变量没有作用,不传没有影响)。

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