There was an error while loading. Please reload this page.
1 parent 915b09f commit e8e9f51Copy full SHA for e8e9f51
1 file changed
Sprint-2/2-mandatory-errors/2.js
@@ -4,5 +4,8 @@
4
const cityOfBirth = "Bolton";
5
console.log(`I was born in ${cityOfBirth}`);
6
7
-//reason is the console.log was entered before the text
+// the error is ReferenceError: Cannot access 'cityOfBirth' before initialization,
8
+// reason is the console.log was entered before the variable declaration.
9
+// Console.log cannot run something that is not there yet.
10
+// To fix it , move the const declaration above the console.log
11
0 commit comments