fix(curriculum): typo in lecture the var keyword and hoisting (#59965)

This commit is contained in:
Clarence
2025-04-24 19:34:34 +01:00
committed by GitHub
parent c6543b2ddf
commit 1faac313e1

View File

@@ -26,7 +26,7 @@ var x = 5;
console.log(5); // 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 inialization `x = 5`. It's as if the code were rewritten like this:
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:
```js
var x;