File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
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-
8- function square ( 3 ) {
9- return num * num ;
10- }
7+ // It throw a error - because of invalid parameter (can't use a number as a parameter name)
8+ // function square(3) {
9+ // return num * num;
10+ // }
1111
1212// =============> write the error message here
13-
13+ // SyntaxError: Unexpected number
1414// =============> explain this error message here
15-
15+ // The "Unexpected number" error arises when a numeral is improperly positioned or used within JavaScript code.
1616// Finally, correct the code to fix the problem
17-
1817// =============> write your new code here
18+ function square ( num ) {
19+ return num * num ;
20+ }
1921
20-
22+ console . log ( square ) ;
You can’t perform that action at this time.
0 commit comments