You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Currently trying to print the string "I was born in Bolton" but it isn't working...
2
2
// what's the error ?
3
-
4
-
console.log(`I was born in ${cityOfBirth}`);
5
3
constcityOfBirth="Bolton";
4
+
console.log(`I was born in ${cityOfBirth}`);
5
+
6
+
//The error is that the variable cityOfBirth is being used before it has been declared.JavaScript executes code line by line from top to bottom, so you must declare and assign a value to the variable before using it.
7
+
// In JavaScript, variables declared with let or const are not hoisted, meaning they cannot be accessed before their declaration.
0 commit comments