Skip to content

Commit d0520a0

Browse files
committed
explanation of the function
1 parent a03c919 commit d0520a0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • Sprint-2/1-key-errors

Sprint-2/1-key-errors/2.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
// Predict and explain first BEFORE you run any code...
3+
//function is there to calculate the square parameter
34

45
// this function should square any number but instead we're going to get an error
56

@@ -10,11 +11,18 @@ function square(3) {
1011
}
1112

1213
// =============> write the error message here
14+
// we are returning the num - but the parameter already given as an argument not a parameter 3 -
15+
// for the function to recognize num we would need to give this to the function as a parameter
1316

1417
// =============> explain this error message here
18+
//unexpected number - the function has an unexpected argument
1519

1620
// Finally, correct the code to fix the problem
1721

1822
// =============> write your new code here
23+
//function square(num) {
24+
//return num * num;
25+
//}
26+
//square(3)
1927

2028

0 commit comments

Comments
 (0)