Skip to content

Commit 3f94fb8

Browse files
committed
key errot2
1 parent 7916b12 commit 3f94fb8

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

  • Sprint-3/1-key-errors

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
2-
// Predict and explain first BEFORE you run any code...
1+
// SyntaxError: Unexpected token '3'
32

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

65
// =============> write your prediction of the error here
76

8-
function square(3) {
9-
return num * num;
10-
}
11-
12-
// =============> write the error message here
7+
//function square(3) {
8+
// return num * num;
9+
//}
1310

11+
// =============> write the error message here SyntaxError: Unexpected token (1:16)
1412
// =============> explain this error message here
1513

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

1816
// =============> write your new code here
17+
function square(num) {
18+
return num * num;
19+
}
1920

20-
21+
console.log(square(3));

0 commit comments

Comments
 (0)