File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Predict and explain first...
22
3- // Why will an error occur when this program runs?
4- // =============> decimalNumber is a constant variable, and cannot be changed.
3+ // Why will an error occur when this program runs?
4+ // =============> decimalNumber is a constant variable, and cannot be changed.
55// The code is attempting to change it which will cause an error.
66
77// Try playing computer with the example to work out what is going on
@@ -19,8 +19,7 @@ console.log(decimalNumber);
1919
2020// Finally, correct the code to fix the problem
2121function convertToPercentage ( decimalNumber ) {
22- decimalNumber = 0.5 ;
2322 const percentage = `${ decimalNumber * 100 } %` ;
2423 return percentage ;
2524}
26- console . log ( convertToPercentage ( 0.5 ) ) ;
25+ console . log ( convertToPercentage ( 0.5 ) ) ;
You can’t perform that action at this time.
0 commit comments