File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Sprint-1/2-mandatory-errors Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 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 } ` ) ;
4+ // console.log(`I was born in ${cityOfBirth}`);
55const cityOfBirth = "Bolton" ;
6+
7+ /*/home/cyf/CYF/ITP/Module-Structuring-and-Testing-Data/Sprint-1/2-mandatory-errors/2.js:4
8+ console.log(`I was born in ${cityOfBirth}`);
9+ ^
10+
11+ ReferenceError: Cannot access 'cityOfBirth' before initialization
12+
13+ this error is because we are trying to access the variable cityOfBirth before it is initialized and assigned a value.
14+ the console.log should be after the variable declaration and assignment
15+
16+ */
17+ console . log ( `I was born in ${ cityOfBirth } ` ) ;
You can’t perform that action at this time.
0 commit comments