Skip to content

Commit 0504972

Browse files
declare variable before logging output
1 parent 4b1680e commit 0504972

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
3+
// It's shows the reference error because variables should be declared first then the console.log().
4+
// console.log(`I was born in ${cityOfBirth}`);
5+
// const cityOfBirth = "Bolton";
6+
/*we need to put declare variables(const cityOfBirth = "Bolton";) in first line in second line we use used console.log to print the output*/
37
const cityOfBirth = "Bolton";
4-
5-
console.log(`I was born in ${cityOfBirth}`);
6-
7-
/*we need to put declare variables(const cityOfBirth = "Bolton";) in first line in second line we use used console.log to print the output*/
8+
console.log(`I was born in ${cityOfBirth}`);

0 commit comments

Comments
 (0)