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-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
// Why will an error occur when this program runs?
4
4
// =============> write your prediction here
5
-
5
+
// I guess decimalNumber is declared already so an error will be thrown.
6
6
// Try playing computer with the example to work out what is going on
7
7
8
8
functionconvertToPercentage(decimalNumber){
@@ -15,6 +15,13 @@ function convertToPercentage(decimalNumber) {
15
15
console.log(decimalNumber);
16
16
17
17
// =============> write your explanation here
18
-
18
+
// It is the same as i have predicted decimalNumber has already declared. And also there will be a reference error decimalNumber is logged outside the function.
0 commit comments