Skip to content

Commit 7d0d970

Browse files
committed
task 2.js explained
1 parent f80c15b commit 7d0d970

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
const cityOfBirth = "Bolton";
55
console.log(`I was born in ${cityOfBirth}`);
6+
7+
8+
// In this task, the variable was not assigned before attempting to print. Therefore, it gives the error "ReferenceError: Cannot access 'cityOfBirth' before initialization"
9+
// The solution would be to assign the variable "cityOfBirth" first before printing the code.

0 commit comments

Comments
 (0)