File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
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+ //I think it will give an error because the function parameter can not be a number like (3).
78
8- function square ( 3 ) {
9- return num * num ;
10- }
11-
12- // =============> write the error message here
9+ // =============> write the error message here
10+ // SyntaxError: Unexpected number
1311
1412// =============> explain this error message here
15-
13+ // the parameter can't be a number like (3),also changing num * num to number instead to match the parameter.
1614// Finally, correct the code to fix the problem
1715
1816// =============> write your new code here
17+ function square ( number ) {
18+ return number * number ;
19+ }
20+ console . log ( square ( 3 ) ) ;
21+
1922
2023
You can’t perform that action at this time.
0 commit comments