Skip to content

Commit 609693d

Browse files
committed
update 2.js
1 parent 1234dae commit 609693d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
33

4-
console.log(`I was born in ${cityOfBirth}`);
5-
const cityOfBirth = "Bolton";
6-
7-
/* The log is trying to use cityOfBirth before the variable exists.
4+
/* The log was trying to use cityOfBirth before the variable exists.
85
JavaScript reads the code in order, so the variable must be declared before it is used.*/
96
// I logged the message before creating the cityOfBirth variable, so JavaScript couldn't find it yet. I need to declare the variable before using it.
107
const cityOfBirth = "Bolton";

0 commit comments

Comments
 (0)