File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 44// this function should square any number but instead we're going to get an error
55
66// =============> write your prediction of the error here
7+ // num has not been defined and the parameter is not used in the function;
8+ // it has a number instead
9+
710
811function square ( 3 ) {
912 return num * num ;
1013}
1114
1215// =============> write the error message here
16+ // SyntaxError: Unexpected number
17+
1318
1419// =============> explain this error message here
20+ // The error message is saying that it was not expecting a number in the function
21+ // declaration. This is because the parameter should be a variable name, not a number
1522
1623// Finally, correct the code to fix the problem
1724
1825// =============> write your new code here
19-
26+ function square ( num ) {
27+ return num * num ;
28+ }
2029
You can’t perform that action at this time.
0 commit comments