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
{{ message }}
Repository navigation
Commit 7cd8ae3
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Sprint-3/1-key-errors/1.js
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
-
// Predict and explain first...
1
+
// Predict and explain first...:It doesn't run.We have a syntaxError.
2
2
3
-
// Why will an error occur when this program runs?
4
-
// =============> write your prediction here
3
+
// Why will an error occur when this program runs?because decimalNumber is declared.
4
+
// as a parameter and then declared again using const.
5
+
6
+
// =============> write your prediction here:We will have a SyntaxError because decimalNumber is a parameter of the function, but it is declared again using const inside the function.
5
7
6
8
// Try playing computer with the example to work out what is going on
7
9
@@ -14,7 +16,14 @@ function convertToPercentage(decimalNumber) {
14
16
15
17
console.log(decimalNumber);
16
18
17
-
// =============> write your explanation here
19
+
// =============> write your explanation here:decimalNumber is inside the function, so we can not use it outside the function.
0 commit comments