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 de74a88
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
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,25 @@
2
2
3
3
// Why will an error occur when this program runs?
4
4
// =============> write your prediction here
5
+
// The Program will throw an error because variable 'decimalNumber' is declared twice.
5
6
6
7
// Try playing computer with the example to work out what is going on
7
8
8
-
functionconvertToPercentage(decimalNumber){
9
-
constdecimalNumber=0.5;
10
-
constpercentage=`${decimalNumber*100}%`;
9
+
// function convertToPercentage(decimalNumber) {
10
+
// const decimalNumber = 0.5;
11
+
// const percentage = `${decimalNumber * 100}%`;
11
12
12
-
returnpercentage;
13
-
}
13
+
// return percentage;
14
+
// }
14
15
15
-
console.log(decimalNumber);
16
-
17
-
// =============> write your explanation here
16
+
//console.log(decimalNumber);
18
17
18
+
// =============> write your explanation here : SyntaxError: Identifier 'decimalNumber' has already been declared => line 10 varibale decimalNumber should not be declared again. g
0 commit comments