Skip to content

Commit 2de618e

Browse files
Fix comment for clarity on ReferenceError in 2.js
1 parent a6a4588 commit 2de618e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
3-
// Answer: because javascript runs from top to bottom, by declaring the const after running console.log the function throws an error because the decleration is done ater console.log
3+
// Answer: because javascript runs from top to bottom, by declaring the const after running console.log the function throws an error because the decleration is done ater console.log
4+
// ReferenceError: Cannot access 'cityOfBirth' before initialization
45

56
const cityOfBirth = "Bolton";
67
console.log(`I was born in ${cityOfBirth}`);

0 commit comments

Comments
 (0)