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
// Why will an error occur when this program runs?
4
-
// =============> write your prediction here
5
-
4
+
// decimalNumber was already declared on the line 8. it leads to an error declaring it the second time on the line 9.
5
+
// line 15 is in global scope and tries output value of the local variable from inside of the function.
6
6
// Try playing computer with the example to work out what is going on
7
7
8
8
functionconvertToPercentage(decimalNumber){
@@ -14,7 +14,13 @@ function convertToPercentage(decimalNumber) {
14
14
15
15
console.log(decimalNumber);
16
16
17
-
// =============> write your explanation here
17
+
// i will declare the decimalNumber variable before the function and call the function. i would also removed the percentage variable because it doesn't make anything useful in this piece of code.
0 commit comments