Skip to content

Commit 9bcb86b

Browse files
committed
I had to delete the broken code
1 parent e838340 commit 9bcb86b

File tree

1 file changed

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

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
// Predict and explain first...
22

33
// Why will an error occur when this program runs?
4+
45
// =============> write your prediction here
6+
57
// the error occur because the decimalNumber has already been declared.
68

79
// Try playing computer with the example to work out what is going on
810

9-
function convertToPercentage(decimalNumber) {
10-
const decimalNumber = 0.5;
11-
const percentage = `${decimalNumber * 100}%`;
12-
13-
return percentage;
14-
}
1511

16-
console.log(decimalNumber);
1712

1813
// =============> write your explanation here
14+
1915
// I tried to run the code it gives me SyntaxError,that the decimalNumber has already been declared, we can see in the parameter already has name decimalNumber.
2016
// thats why declaring it again inside the function, causes an error.
2117

0 commit comments

Comments
 (0)