Merge pull request #3088 from printfinn/patch-1

fix: 1-js/06-advanced-functions/05-global-object
This commit is contained in:
Ilya Kantor 2022-07-10 23:46:18 +02:00 committed by GitHub
commit eedb3f3bd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ var gVar = 5;
alert(window.gVar); // 5 (became a property of the global object)
```
The same effect have function declarations (statements with `function` keyword in the main code flow, not function expressions).
Function declarations have the same effect (statements with `function` keyword in the main code flow, not function expressions).
Please don't rely on that! This behavior exists for compatibility reasons. Modern scripts use [JavaScript modules](info:modules) where such a thing doesn't happen.