Skip to content

Commit 8a162e3

Browse files
committed
Fix and explain 'unexpected number' SyntaxError in square() (1-key-errors/2.js)
1 parent f4e38d3 commit 8a162e3

File tree

1 file changed

+8
-3
lines changed
  • Sprint-2/1-key-errors

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ function square(3) {
1010
}
1111

1212
// =============> write the error message here
13-
13+
// SyntaxError: Unexpected number
1414
// =============> explain this error message here
15-
15+
// The "Unexpected number"
1616
// Finally, correct the code to fix the problem
17-
17+
// The "Unexpected number" error arises when a number is improperly positioned or used within JvaScript code
1818
// =============> write your new code here
19+
function square(num){
20+
return num * num;
21+
}
22+
23+
console.log(square);
1924

2025

0 commit comments

Comments
 (0)