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 f818c7f
Browse filesBrowse the repository at this point in the historyBrowse files
// 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
5
// I think this code will throw an error because we are passing an actual number into the parameters but javascript only allows a variable to be passed into the parameters that can be used to store information so i would need to change the number 3 into num ( and num here would act as the placeholder for any number passed in when the function gets called later) for this code to work because as it is i believe num would be undefined as it hasn't been defined anywhere.
7
6
8
-
functionsquare(3){
9
-
returnnum*num;
10
-
}
7
+
//function square(3) {
8
+
// return num * num;
9
+
//}
11
10
12
-
// =============> write the error message here
11
+
// error message: SyntaxError: Unexpected number
13
12
14
-
// =============> explain this error message here
13
+
// This error means javascript couldn't run the code because it doesn't accept numbers as a parameter.
0 commit comments