File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
22// Predict and explain first BEFORE you run any code...
3-
3+
44// this function should square any number but instead we're going to get an error
5+ //we are giving a value for the input instead of name that can hold different values.
56
67// =============> write your prediction of the error here
8+ //syntaxerror related to the function input "(3)"
79
8- function square ( 3 ) {
9- return num * num ;
10- }
10+ // function square(3) {
11+ // return num * num;
12+ // }
1113
1214// =============> write the error message here
1315
1416// =============> explain this error message here
15-
17+ // we gave a placeholder for the function instead of value that can't be changed.
1618// Finally, correct the code to fix the problem
1719
1820// =============> write your new code here
1921
2022
23+ function square ( num ) {
24+ return num * num ;
25+ }
26+
27+ console . log ( square ( 3 ) ) ;
You can’t perform that action at this time.
0 commit comments