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/2.js
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,22 @@
3
3
4
4
// this function should square any number but instead we're going to get an error
5
5
6
-
// =============> write your prediction of the error here
6
+
// =============> write your prediction of the error here: There will be an error because we put a value (3) as a function's parameter instead of using variable names. We also don't know where num comes from as we have't defined/ declared that.
7
7
8
-
functionsquare(3){
9
-
returnnum*num;
10
-
}
8
+
// function square(3) {
9
+
// return num * num;
10
+
// }
11
11
12
-
// =============> write the error message here
12
+
// =============> write the error message here: SyntaxError: Unexpected number
13
13
14
-
// =============> explain this error message here
14
+
// =============> explain this error message here: We get an error message saying that there is an unexpected number on line 8 (Syntax Error).
0 commit comments