Skip to content

Commit 80dc521

Browse files
Effect new changes.
1 parent 933dd7f commit 80dc521

File tree

1 file changed

+9
-6
lines changed
  • Sprint-2/1-key-errors

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
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+
// A number cannot be used as a parameter.=============> write your prediction of the error here
77

8-
function square(3) {
9-
return num * num;
10-
}
118

12-
// =============> write the error message here
9+
// SyntaxError: Unexpected number =============> write the error message here
10+
1311

14-
// =============> explain this error message here
12+
// The parameter is not meant to be a number. Also we are trying to return num that was not never created. =============> explain this error message here
1513

1614
// Finally, correct the code to fix the problem
1715

16+
17+
function square (num) {
18+
return num * num;
19+
20+
}
1821
// =============> write your new code here
1922

2023

0 commit comments

Comments
 (0)