Skip to content

Commit 08f2261

Browse files
committed
Add explanation comment for cityOfBirth reference error
1 parent 557caf0 commit 08f2261

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ console.log(`I was born in ${cityOfBirth}`);
55
const cityOfBirth = "Bolton";
66

77
//ReferenceError: Cannot access 'cityOfBirth' before initialization.
8+
//console.log tries to use cityOfBirth inside the template literal, but cityOfBirth has not been declared yet at that point in the code.

0 commit comments

Comments
 (0)