Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f3555ee

Browse files
fixed small typos
1 parent fc3f811 commit f3555ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎1-js/06-advanced-functions/04-var/article.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if (true) {
5252
}
5353

5454
*!*
55-
alert(test); // Error: test is not defined
55+
alert(test); // ReferenceError: test is not defined
5656
*/!*
5757
```
5858

@@ -82,7 +82,7 @@ function sayHi() {
8282
}
8383

8484
sayHi();
85-
alert(phrase); // Error: phrase is not defined
85+
alert(phrase); // ReferenceError: phrase is not defined
8686
```
8787

8888
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.
@@ -231,7 +231,7 @@ The Function Expression is wrapped with parenthesis `(function {...})`, because
231231

232232
```js run
233233
// Tries to declare and immediately call a function
234-
function() { // <-- Error: Function statements require a function name
234+
function() { // <-- SyntaxError: Function statements require a function name
235235

236236
var message = "Hello";
237237

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /