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 70a5ed9 commit 30a2809Copy full SHA for 30a2809
1 file changed
Sprint-2/1-key-errors/2.js
@@ -3,18 +3,21 @@
3
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
+// =============> the error message will be about 'num' not being declared.
7
8
function square(3) {
9
return num * num;
10
}
11
12
-// =============> write the error message here
+// =============> Uncaught SyntaxError: Illegal return statement.
13
14
-// =============> explain this error message here
+// =============> The error message is because this num is not a valid variable as it has been undeclared.
15
16
// Finally, correct the code to fix the problem
17
18
// =============> write your new code here
19
+function square(num) {
20
+ return num * num;
21
+}
22
23
0 commit comments