Skip to content

Commit 21914bb

Browse files
authored
Correct variable declaration for cityOfBirth
Fix variable declaration order to avoid reference error.
1 parent e0b3256 commit 21914bb

File tree

1 file changed

+3
-1
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+3
-1
lines changed

Sprint-1/2-mandatory-errors/2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
33

4-
console.log(`I was born in ${cityOfBirth}`);
54
const cityOfBirth = "Bolton";
5+
console.log(`I was born in ${cityOfBirth}`);
6+
7+
// the error is that the variable 'cityOfBirth' is declared after the statement it is used in

0 commit comments

Comments
 (0)