File tree Expand file tree Collapse file tree
Sprint-2/2-mandatory-errors Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// trying to create an age variable and then reassign the value by 1
22
3- const age = 33 ;
3+ let age = 33 ;
44age = age + 1 ;
5+
6+ console . log ( age )
7+
8+ // The TypeError: Assignment to constant variable implies we are trying to reassign the variable twice.
9+ // This case, I have used let instead in order to allow the variable to be reused.
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 } ` ) ;
54const cityOfBirth = "Bolton" ;
5+ console . log ( `I was born in ${ cityOfBirth } ` ) ;
6+
7+
8+ // The error is ReferenceError: Cannot access 'cityOfBirth' before initialization
9+ // Answer: the correct variable is not called
10+ // I changed the console to print the actual variable value
You can’t perform that action at this time.
0 commit comments