There was an error while loading. Please reload this page.
1 parent 8b85d0f commit c81c96dCopy full SHA for c81c96d
1 file changed
Sprint-2/2-mandatory-errors/2.js
@@ -4,4 +4,6 @@
4
const cityOfBirth = "Bolton";
5
console.log(`I was born in ${cityOfBirth}`);
6
7
-// Answer: I switched the lines around, so cityOfBirth gets declared before it is referenced.
+// Answer: I got the error message ReferenceError: Cannot access 'cityOfBirth' before initialization
8
+// This is because the program tries to access cityOfBirth before it has been initialized.
9
+// I switched the lines around, so cityOfBirth gets declared before it is referenced.
0 commit comments