From f3555ee990cffb1853b6dd7653d00b00a84c7874 Mon Sep 17 00:00:00 2001 From: Nazar Date: Sun, 20 Dec 2020 15:00:41 +0200 Subject: [PATCH] fixed small typos --- 1-js/06-advanced-functions/04-var/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/06-advanced-functions/04-var/article.md b/1-js/06-advanced-functions/04-var/article.md index 205c0a18..d433cbc5 100644 --- a/1-js/06-advanced-functions/04-var/article.md +++ b/1-js/06-advanced-functions/04-var/article.md @@ -52,7 +52,7 @@ if (true) { } *!* -alert(test); // Error: test is not defined +alert(test); // ReferenceError: test is not defined */!* ``` @@ -82,7 +82,7 @@ function sayHi() { } sayHi(); -alert(phrase); // Error: phrase is not defined +alert(phrase); // ReferenceError: 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. @@ -231,7 +231,7 @@ The Function Expression is wrapped with parenthesis `(function {...})`, because ```js run // Tries to declare and immediately call a function -function() { // <-- Error: Function statements require a function name +function() { // <-- SyntaxError: Function statements require a function name var message = "Hello";