Skip to content

Commit 54358d2

Browse files
committed
modified answer of 2-mandatory-errors 2.js
1 parent a6fb318 commit 54358d2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
33

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

77
//Initiation should access before the declaration.
8-
//error message: Error: Cannot find module '/Users/rogerger1220/Documents/CYF/Module-JavaScript-Fundamentals/Sprint-2/2.js'
8+
//error message: Error: ReferenceError: Cannot access 'cityOfBirth' before initialization
99
// at Module._resolveFilename (node:internal/modules/cjs/loader:1564:15)
1010
// at wrapResolveFilename (node:internal/modules/cjs/loader:1118:27)
1111
// at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1142:10)
@@ -16,6 +16,6 @@ const cityOfBirth = "Bolton";
1616
// at node:internal/main/run_main_module:33:47 {
1717
// code: 'MODULE_NOT_FOUND',
1818
// requireStack: []
19-
}
19+
2020

2121
// Node.js v24.21.0

0 commit comments

Comments
 (0)