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 variable was initially declared after console.log so it threw an error message. The error message "cannot access 'cityOfBirth' before initialization at Object" is saying that javascript cannot access the variable before it has been initialised. I have initialised the variable on line 3 now so the message prints in the console now.
0 commit comments