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 307d6b9
Browse filesBrowse the repository at this point in the historyBrowse files
// Predict and explain first BEFORE you run any code...
3
+
// Prediction: We will get an error definitely but i'm not sure if it's going to be a ReferenceError or a SyntaxError
3
4
4
5
// this function should square any number but instead we're going to get an error
5
6
6
7
// =============> write your prediction of the error here
7
8
8
-
functionsquare(3){
9
-
returnnum*num;
10
-
}
9
+
// function square(3) {
10
+
// return num * num;
11
+
// }
12
+
13
+
// console.log(square(2));
11
14
12
15
// =============> write the error message here
13
16
17
+
// =============> ERROR MESSAGE: SyntaxError: Unexpected number
18
+
14
19
// =============> explain this error message here
15
20
21
+
// =============> EXPLANATION: The SyntaxError: Unexpected number happened because the function was expecting an identifier in the parameter ('num') and not a number ('3') which triggered the error
0 commit comments