Merge pull request #2222 from vsemozhetbyt/patch-11

Remove possibly outdated comment
This commit is contained in:
Ilya Kantor 2020-10-20 23:25:18 +03:00 committed by GitHub
commit ae723281e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,7 +82,7 @@ function sayHi() {
}
sayHi();
alert(phrase); // Error: phrase is not defined (Check the Developer Console)
alert(phrase); // Error: phrase is not defined
```
As we can see, `var` pierces through `if`, `for` or other code blocks. That's because a long time ago in JavaScript, blocks had no Lexical Environments, and `var` is a remnant of that.