Skip to content

Commit 5bc72b3

Browse files
change variable position
1 parent a6dbd79 commit 5bc72b3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
3-
4-
console.log(`I was born in ${cityOfBirth}`);
53
const cityOfBirth = "Bolton";
4+
console.log(`I was born in ${cityOfBirth}`);
5+
// This error (Cannot access 'cityOfBirth' before initialization) is because we need to declare the variable before using it.
6+

0 commit comments

Comments
 (0)