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
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
1
// Predict and explain first...
2
-
3
2
// Why will an error occur when this program runs?
4
-
// =============> write your prediction here
3
+
// =============> The error will be a syntax error because the variable decimalNumber has already been declared as a parameter. The console log is trying to access decimalNumber which is not within its scope.
5
4
6
5
// Try playing computer with the example to work out what is going on
7
6
@@ -14,7 +13,13 @@ function convertToPercentage(decimalNumber) {
14
13
15
14
console.log(decimalNumber);
16
15
17
-
// =============> write your explanation here
16
+
// =============> I got a syntax error that the variable is already declared.
0 commit comments