File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
22// Predict and explain first BEFORE you run any code...
3- // i predict that the code will fail because js expects a variable name ,not a number and 3 is a number.
43
54// this function should square any number but instead we're going to get an error
65
76// =============> write your prediction of the error here
8- // Uncaught SyntaxError: Unexpected number
97
108function square ( 3 ) {
119 return num * num ;
1210}
1311
1412// =============> write the error message here
15- //Uncaught SyntaxError: Unexpected number
1613
1714// =============> explain this error message here
18- // function parameters must be identifiers (variable names) such num ,x numbers can not be used like variable names
19- // and so the engine will be unable to read the code and cause synx errorS
2015
21- // Finall correct the code to fix the problem
16+ // Finally, correct the code to fix the problem
2217
2318// =============> write your new code here
24- function square ( num ) {
25- return num * null ;
26- }
19+
2720
You can’t perform that action at this time.
0 commit comments