File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 11
22// Predict and explain first BEFORE you run any code...
3-
43// this function should square any number but instead we're going to get an error
5-
6- // =============> write your prediction of the error here
4+ // =============> The error will be a syntax error. A number is not a valid variable name - variable names cannot start with a number.
75
86function square ( 3 ) {
97 return num * num ;
108}
119
12- // =============> write the error message here
10+ // =============> write the error message here: SyntaxError: Unexpected number. The error is because the variable name cannot start with a number.
1311
14- // =============> explain this error message here
12+ // =============> explain this error message here: You cannot begin a variable name with a number
1513
1614// Finally, correct the code to fix the problem
1715
18- // =============> write your new code here
19-
20-
16+ // =============> write your new code here:
17+ // function square(num) {
18+ // return num * num;
19+ // }
You can’t perform that action at this time.
0 commit comments