Skip to content

Commit 8aa69c9

Browse files
author
JorvanW
committed
removed line that affects code output
1 parent e5b65ca commit 8aa69c9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • Sprint-2/1-key-errors

Sprint-2/1-key-errors/1.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
2121
function 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));

0 commit comments

Comments
 (0)