Skip to content

Commit f77a0be

Browse files
committed
done 2.js
1 parent 4a48765 commit f77a0be

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

Sprint-2/errors/2.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,30 @@
33

44
// this function should square any number but instead we're going to get an error
55

6-
function square(3) {
6+
7+
/*
8+
parameter are in the function, in this example we are not receiving any parameter and this we can not write the
9+
argument directly,
10+
11+
arguments are in the console.log and we are not calling the function so that's why we are not having any response.
12+
13+
function square(3) {
14+
return num * num;
15+
16+
}
17+
18+
*/
19+
20+
/*================== fixed =======================*/
21+
22+
23+
function square(num) {
724
return num * num;
825
}
926

27+
console.log(square(7))
28+
29+
30+
31+
1032

0 commit comments

Comments
 (0)