Skip to content

Commit ef80dd1

Browse files
committed
fixed the bug on the code - the variable wasn't declared before logging the string
1 parent 3a4947c commit ef80dd1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • Sprint-1/2-mandatory-errors

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
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+
// the variable cityOfBirth was after the console log which means you cannot log before you actually have the variable

0 commit comments

Comments
 (0)