File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
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 num parameter should be mentioned inside the function square instead of the number 3.
7+ // then it should be called as square (3) in the console.log statement.
78
8- function square ( 3 ) {
9- return num * num ;
10- }
9+ //function square(3) {
10+ //return num * num;
11+ //}
12+
13+ // =============> function square(3) syntaxError: Unexpected number.
14+ // =============> 3 wasn't expected... instead a declaration like 'num' was expected.
1115
12- // =============> write the error message here
1316
14- // =============> explain this error message here
1517
1618// Finally, correct the code to fix the problem
1719
1820// =============> write your new code here
21+ function square ( num ) {
22+ return num * num ;
23+ }
24+
25+ console . log ( square ( 3 ) ) ;
1926
2027
You can’t perform that action at this time.
0 commit comments