Skip to content

Commit 0835346

Browse files
committed
Interpret error message for when a variable is used before declaration
1 parent 5b0c0bc commit 0835346

File tree

1 file changed

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

1 file changed

+2
-0
lines changed

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

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

44
console.log(`I was born in ${cityOfBirth}`);
55
const cityOfBirth = "Bolton";
6+
7+
// The error message 'Cannot access 'cityOfBirth' before initialization' occured because the 'const' variable was used before it was declared.

0 commit comments

Comments
 (0)