We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16c3259 commit 5a68f2cCopy full SHA for 5a68f2c
Sprint-1/2-mandatory-errors/2.js
@@ -1,5 +1,9 @@
1
// Currently trying to print the string "I was born in Bolton" but it isn't working...
2
// what's the error ?
3
4
-console.log(`I was born in ${cityOfBirth}`);
5
const cityOfBirth = "Bolton";
+console.log(`I was born in ${cityOfBirth}`);
6
+
7
+// ReferenceError: Cannot access 'cityOfBirth' before initialization
8
+// This error appears because the variable cityOfBirth is created after the console.log, so the computer cannot access it.
9
+// To fix the error I just moved the console.log below the variable declaration
0 commit comments