There was an error while loading. Please reload this page.
1 parent 507f02a commit 6f4e46fCopy full SHA for 6f4e46f
1 file changed
Sprint-3/1-key-errors/2.js
@@ -5,16 +5,31 @@
5
6
// =============> write your prediction of the error here
7
8
+// Prediction:
9
+// 1. This will give reference error.
10
+//
11
+
12
13
function square(3) {
14
return num * num;
15
}
16
17
// =============> write the error message here
18
19
+// SyntaxError: Unexpected number
20
21
// =============> explain this error message here
22
23
+// The function expects a parameter name and it shouldn't start with a number.
24
+// num should be the parameter and later 3 can be passed as an argument.
25
26
// Finally, correct the code to fix the problem
27
28
// =============> write your new code here
29
30
+function square(num) {
31
+ return num * num;
32
+}
33
34
+console(square(3));
35
0 commit comments