File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 11
2+
23// Predict and explain first BEFORE you run any code...
34
45// this function should square any number but instead we're going to get an error
56
6- // =============> write your prediction of the error here
7+ // =============> The num parameter should be mentioned inside the function square instead of the number 3.
8+ // then it should be called as square (3) in the console.log statement.
79
8- function square ( 3 ) {
9- return num * num ;
10- }
10+ //function square(3) {
11+ //return num * num;
12+ //}
13+
14+ // =============> function square(3) syntaxError: Unexpected number.
15+ // =============> 3 wasn't expected... instead a declaration like 'num' was expected.
1116
12- // =============> write the error message here
1317
14- // =============> explain this error message here
1518
1619// Finally, correct the code to fix the problem
1720
1821// =============> write your new code here
22+ function square ( num ) {
23+ return num * num ;
24+ }
1925
20-
26+ console . log ( square ( 3 ) ) ;
You can’t perform that action at this time.
0 commit comments