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 a2d891a commit 812cf83Copy full SHA for 812cf83
Sprint-2/1-key-errors/2.js
@@ -5,16 +5,25 @@
5
6
// =============> write your prediction of the error here
7
8
-function square(3) {
9
- return num * num;
10
-}
+// function square(3) {
+// return num * num;
+// }
11
12
// =============> write the error message here
13
+//SyntaxError: Unexpected number
14
+
15
16
// =============> explain this error message here
17
+// passing nunber 3 in the function without declarint it as a number to be square
18
19
// Finally, correct the code to fix the problem
20
21
// =============> write your new code here
22
23
+function square(num) {
24
+ const squareNumber= (num * num);
25
+ return squareNumber ;
26
+}
27
28
+console.log (square(3));
29
+console.log (square(4));
0 commit comments