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
// Predict and explain first BEFORE you run any code...
3
2
4
3
// this function should square any number but instead we're going to get an error
5
4
6
-
// =============> write your prediction of the error here
5
+
// =============> write your prediction of the error here : There will be a syntax error because the parameter name cannot be a number.
7
6
8
-
functionsquare(3){
9
-
returnnum*num;
7
+
functionsquare(3){
8
+
returnnum*num;
10
9
}
11
10
12
-
// =============> write the error message here
11
+
// =============> write the error message here : SyntaxError: Unexpected number.
13
12
14
-
// =============> explain this error message here
13
+
// =============> explain this error message here : /*The error message shows that there is an unexpected number in the function parameter name. Function parameters must be valid identifiers (like variable names) and cannot be numeric literals.*/
0 commit comments