You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-2/1-key-errors/1.js
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
// Predict and explain first...
2
2
3
3
// Why will an error occur when this program runs?
4
-
// =============> write your prediction here
4
+
// =============> write your prediction here
5
+
// the error occur because the decimalNumber has already been declared.
5
6
6
7
// Try playing computer with the example to work out what is going on
7
8
@@ -15,6 +16,13 @@ function convertToPercentage(decimalNumber) {
15
16
console.log(decimalNumber);
16
17
17
18
// =============> write your explanation here
19
+
// 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.
20
+
// thats why declaring it again inside the function, causes an error.
0 commit comments