diff --git a/curriculum/challenges/english/blocks/lecture-the-var-keyword-and-hoisting/67335f45489c5a11b71d0ed5.md b/curriculum/challenges/english/blocks/lecture-the-var-keyword-and-hoisting/67335f45489c5a11b71d0ed5.md index cc2fe49a5b3..4c06c394322 100644 --- a/curriculum/challenges/english/blocks/lecture-the-var-keyword-and-hoisting/67335f45489c5a11b71d0ed5.md +++ b/curriculum/challenges/english/blocks/lecture-the-var-keyword-and-hoisting/67335f45489c5a11b71d0ed5.md @@ -16,7 +16,7 @@ Let's start with variables hoisting, when you declare a variable using the `var` ```js console.log(x); // undefined var x = 5; -console.log(5); // 5 +console.log(x); // 5 ``` In this code even though we use `x` before declaring it we don't get an error, instead we get `undefined`. This is because JavaScript hoists the declaration `var x` to the top of its scope but not the initialization `x = 5`. It's as if the code were rewritten like this: @@ -40,7 +40,7 @@ function sayHello(){ In this case, we can call `sayHello()` before its declaration because the entire function is hoisted to the top of its scope. -It's important to note that hoisting works differently with `let` and `const` declarations introduced in ES6. +It's important to note that hoisting works differently with `let` and `const` declarations introduced in ES6. ```js console.log(y); // Throws a ReferenceError