Skip to content

Commit a56a087

Browse files
committed
Explain error and how to fix
1 parent ea56b8e commit a56a087

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33

44
console.log(`I was born in ${cityOfBirth}`);
55
const cityOfBirth = "Bolton";
6+
7+
//ReferenceError: Cannot access 'cityOfBirth' before initialization
8+
//Trying to use cityOfBirth before it's defined
9+
//To fix, put line 5 before line 4, so it is initialised before use

0 commit comments

Comments
 (0)