There was an error while loading. Please reload this page.
1 parent 7916b12 commit 3f94fb8Copy full SHA for 3f94fb8
1 file changed
Sprint-3/1-key-errors/2.js
@@ -1,20 +1,21 @@
1
-
2
-// Predict and explain first BEFORE you run any code...
+// SyntaxError: Unexpected token '3'
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
7
8
-function square(3) {
9
- return num * num;
10
-}
11
12
-// =============> write the error message here
+//function square(3) {
+// return num * num;
+//}
13
+// =============> write the error message here SyntaxError: Unexpected token (1:16)
14
// =============> explain this error message here
15
16
// Finally, correct the code to fix the problem
17
18
// =============> write your new code here
+function square(num) {
+ return num * num;
19
+}
20
21
+console.log(square(3));
0 commit comments