File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 33
44// this function should square any number but instead we're going to get an error
55
6- // =============> write your prediction of the error here
6+ // =============> the error message will be about 'num' not being declared.
77
88function square ( 3 ) {
99 return num * num ;
1010}
1111
12- // =============> write the error message here
12+ // =============> Uncaught SyntaxError: Illegal return statement.
1313
14- // =============> explain this error message here
14+ // =============> The error message is because this num is not a valid variable as it has been undeclared.
1515
1616// Finally, correct the code to fix the problem
1717
1818// =============> write your new code here
19+ function square ( num ) {
20+ return num * num ;
21+ }
1922
2023
You can’t perform that action at this time.
0 commit comments