File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
22
33// Why will an error occur when this program runs?
4- // =============> because first: the variable decimalNumber is declared twice
5- // second: the parameter decimalNumber is assigned to a value inside the function
4+ // =============> write your prediction here
65
76// Try playing computer with the example to work out what is going on
87
@@ -15,13 +14,7 @@ function convertToPercentage(decimalNumber) {
1514
1615console . log ( decimalNumber ) ;
1716
18- // =============> Identifier 'decimalNumber' has already been declared is the error msg thrown by the code
17+ // =============> write your explanation here
1918
2019// Finally, correct the code to fix the problem
21- // =============>
22- function convertToPercentage ( decimalNumber ) {
23- // const decimalNumber = 0.5; this line must be deleted
24- const percentage = `${ decimalNumber * 100 } %` ;
25-
26- return percentage ;
27- }
20+ // =============> write your new code here
You can’t perform that action at this time.
0 commit comments