Skip to content

Commit 5468f43

Browse files
committed
interpreted ReferenceError in 2.js
1 parent 0c3a7bf commit 5468f43

File tree

1 file changed

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

1 file changed

+4
-0
lines changed

Sprint-1/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+
/* A lexical variable was accessed before it was initialized. This happens within any scope (global, module, function, or block) when variables declared with let or const are accessed before the place where they are declared has been executed
9+
*/

0 commit comments

Comments
 (0)