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...
2
3
3
4
// this function should square any number but instead we're going to get an error
4
5
5
6
// =============> write your prediction of the error here
6
-
//it will throw an error for use of a primitive value instead of a variable.
7
7
8
-
//function square(3) {
9
-
// return num * num;
10
-
//}
8
+
functionsquare(3){
9
+
returnnum*num;
10
+
}
11
11
12
-
// =============> write the error message here, SyntaxError: Unexpected number
12
+
// =============> write the error message here
13
13
14
14
// =============> explain this error message here
15
-
//this error message is becasue we cannot pass a direct value to a function when creating it but rather when we call it. Instead we need to give it a parameter that can then hold the value that we want to pass to the function.
0 commit comments