Skip to content

Commit 71935b5

Browse files
committed
correcet code that fixed the error
1 parent 22b0b87 commit 71935b5

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

  • Sprint-3/1-key-errors

‎Sprint-3/1-key-errors/2.js‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
21
// Predict and explain first BEFORE you run any code...
32

4-
5-
63
// this function should square any number but instead we're going to get an error
74

85
// =============> function square(), shouldn't give a value to it , we can only pass
96
// an argument when the function is called, with value in it which is called argument.
107

11-
function square(3) {
12-
return num * num;
13-
}
14-
console.log(square())
8+
//function square(3) {
9+
// return num * num;
10+
//}
11+
//console.log(square())
1512

1613
// =============> Unexpected number
1714

@@ -21,7 +18,7 @@ console.log(square())
2118
// Finally, correct the code to fix the problem
2219

2320
// =============> write your new code here
24-
25-
26-
27-
21+
function square(num) {
22+
return num * num;
23+
}
24+
console.log(square(3));

0 commit comments

Comments
 (0)