We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 876bf7b commit 058c055Copy full SHA for 058c055
Sprint-2/1-key-errors/2.js
@@ -4,17 +4,21 @@
4
// this function should square any number but instead we're going to get an error
5
6
// =============> write your prediction of the error here
7
+// line 9 num is not defined.
8
-function square(3) {
9
- return num * num;
10
-}
+// function square(3) {
+// return num * num;
11
+//}
12
13
// =============> write the error message here
-
14
+// SyntaxError: Unexpected number
15
// =============> explain this error message here
16
+// 3 is not a variable for the function to use. It should be a variable name like num or n.
17
// Finally, correct the code to fix the problem
18
19
// =============> write your new code here
20
21
+function square(num) {
22
+ return num * num;
23
+}
24
+console.log(square(3));
0 commit comments