Skip to content

Commit 103bc69

Browse files
committed
add errors task2
1 parent 6b062a6 commit 103bc69

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • Sprint-1/2-mandatory-errors

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
3+
const cityOfBirth = "Bolton";
34

45
console.log(`I was born in ${cityOfBirth}`);
5-
const cityOfBirth = "Bolton";
6+
7+
// return has not been defined before it is used in the console.log statement.
8+
// To fix this, you should declare and assign a value to the variable cityOfBirth before using it in the console.log statement.
9+
// To do this, you can move the line const cityOfBirth = "Bolton"; above the console.log statement.
10+
// This way, the variable will be defined before it is used, and the code will work as expected.

0 commit comments

Comments
 (0)