Skip to content

fix: 1-js/06-advanced-functions/05-global-object/ #1072

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

Merged
merged 2 commits into from
Jul 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 1-js/06-advanced-functions/05-global-object/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var gVar = 5;
alert(window.gVar); // 5(成为了全局对象的属性)
```

具有与函数声明相同的效果(在主代码流中具有 `function` 关键字的语句,而不是函数表达式)。
函数声明(特指在主代码流中具有 `function` 关键字的语句,而不是函数表达式)也有这样的效果

请不要依赖它!这种行为是出于兼容性而存在的。现代脚本使用 [JavaScript modules](info:modules) 所以不会发生这种事情。

Expand Down