File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1-
21// Predict and explain first BEFORE you run any code...
32
43// this function should square any number but instead we're going to get an error
54
65// =============> write your prediction of the error here
6+ //I think the problem in this code is the parameter inside the function. A number cannot be used as a parameter name.
77
8- function square ( 3 ) {
8+ /* function square(3) {
99 return num * num;
10- }
10+ }*/
1111
1212// =============> write the error message here
13+ //SyntaxError: Unexpected number
1314
1415// =============> explain this error message here
16+ //The error message means that number cannot be used as a parameter name.
1517
1618// Finally, correct the code to fix the problem
1719
1820// =============> write your new code here
19-
20-
21+ function square ( num ) {
22+ return num * num ;
23+ }
24+ console . log ( square ( 2 ) ) ;
25+ console . log ( square ( 3 ) ) ;
You can’t perform that action at this time.
0 commit comments