Skip to content

Commit f1b26c1

Browse files
committed
fix: define cityOfBirth variable before usage in console.log
1 parent 4ce90b9 commit f1b26c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sprint-1/errors/2.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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}`);
4+
55
const cityOfBirth = "Bolton";
6+
console.log(`I was born in ${cityOfBirth}`);
7+
8+
// explanation: the error was that the variable cityOfBirth was not defined before it was used in the console.log statement.
9+

0 commit comments

Comments
 (0)