There was an error while loading. Please reload this page.
1 parent 1234dae commit 609693dCopy full SHA for 609693d
1 file changed
Sprint-2/2-mandatory-errors/2.js
@@ -1,10 +1,7 @@
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";
6
-
7
-/* The log is trying to use cityOfBirth before the variable exists.
+/* The log was trying to use cityOfBirth before the variable exists.
8
JavaScript reads the code in order, so the variable must be declared before it is used.*/
9
// I logged the message before creating the cityOfBirth variable, so JavaScript couldn't find it yet. I need to declare the variable before using it.
10
const cityOfBirth = "Bolton";
0 commit comments