Skip to content

Commit 784fb4b

Browse files
committed
Reapply "Update 1.js"
This reverts commit ce5e2ad.
1 parent dc13db4 commit 784fb4b

File tree

1 file changed

+3
-10
lines changed
  • Sprint-2/1-key-errors

1 file changed

+3
-10
lines changed

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
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

1615
console.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

0 commit comments

Comments
 (0)