Skip to content

Commit 39253b5

Browse files
committed
I fixed template string and variable order error
1 parent abb1513 commit 39253b5

File tree

1 file changed

+3
-2
lines changed
  • Sprint-1/2-mandatory-errors

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
2-
// what's the error ?
2+
// The error is caused by using the variable before it is declared
3+
// and by using single quotes instead of backticks for a template string
34

4-
console.log(`I was born in ${cityOfBirth}`);
55
const cityOfBirth = "Bolton";
6+
console.log(`I was born in ${cityOfBirth}`);

0 commit comments

Comments
 (0)