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 55We don't want the computer to run these 2 lines - how can we solve this problem???*/
66
77// we can put "//" in the beginning of the line so computer ignore them
8- // or put them between /* and */
8+ // or put them between /* and */
Original file line number Diff line number Diff line change 33let age = 33 ;
44age = age + 1 ;
55console . log ( `${ age } ` ) ;
6- //We should use let if we want to change the value.
6+ //We should use let if we want to change the value.
7+ //Before I changed const to let node show this error message: (Assignment to constant variable.)
Original file line number Diff line number Diff line change 33const cityOfBirth = "Bolton" ;
44console . log ( `I was born in ${ cityOfBirth } ` ) ;
55// This error (Cannot access 'cityOfBirth' before initialization) is because we need to declare the variable before using it.
6-
Original file line number Diff line number Diff line change 11const cardNumber = 4533787178994213 ;
22const last4Digits = String ( cardNumber ) . slice ( - 4 ) ;
33console . log ( `${ last4Digits } ` ) ;
4- // we get error (cardNumber.slice is not a function) because slice is a String method
4+ // we get error (cardNumber.slice is not a function) because slice is a String method
Original file line number Diff line number Diff line change 11const HourClockTime12 = "8:53pm" ;
22const hourClockTime24 = "20:53" ;
3- //JavaScript variable names cannot start with a number.
3+ //JavaScript variable names cannot start with a number.
You can’t perform that action at this time.
0 commit comments