-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
let 存在变量提升 #1049
Comments
会报错,不能叫做提升吧。 |
如果把“定义”和“赋初值”这两个动作同时完成视为提升的话,let 就不存在提升。 如果只把完成“定义”这个动作视为提升的话,let 就存在提升。 浏览器和node.js实现是把这两个动作拆开的。
MDN 文档认为这也是一种提升:
|
如果把“定义”和“赋初值”这两个动作同时完成视为提升的话,let 就不存在提升。
|
参考:https://stackoverflow.com/questions/31219420/are-variables-declared-with-let-or-const-hoisted/31222689#31222689
The text was updated successfully, but these errors were encountered: