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 cbbe383 commit e3ae3a8Copy full SHA for e3ae3a8
1 file changed
Sprint-1/2-mandatory-errors/2.js
@@ -1,5 +1,6 @@
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}`);
+// The error happens because cityOfBirth is used before it is declared,
+// Variables declared with const cannot be accessed before their declaration.
5
const cityOfBirth = "Bolton";
6
+console.log(`I was born in ${cityOfBirth}`);
0 commit comments