You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-2/2-mandatory-debug/0.js
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@
4
4
//I think that the problem is our function multiply does not return any value but write in console
5
5
// However, we are calling the function inside another console.log and expecting the function to return some value.
6
6
7
-
functionmultiply(a,b){
7
+
/*function multiply(a, b) {
8
8
console.log(a * b);
9
9
}
10
10
11
11
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
12
-
12
+
*/
13
13
// =============> Yeah, when we run the code we get the following output which shows that second console is not able to get the value from the function as the function does not return any value.
14
14
/*
15
15
320
@@ -18,9 +18,8 @@ The result of multiplying 10 and 32 is undefined
18
18
19
19
// Finally, correct the code to fix the problem
20
20
// =============> write your new code here
21
-
/*
21
+
22
22
functionmultiply(a,b){
23
23
returna*b;
24
24
}
25
25
console.log(`The result of multiplying 10 and 32 is ${multiply(10,32)}`);
// In the below function, after return there is a semi colon which syntactically would just return nothing and any line of code below that would not run
4
-
functionsum(a,b){
4
+
/*function sum(a, b) {
5
5
return;
6
6
a + b;
7
-
}
7
+
}*/
8
8
9
9
console.log(`The sum of 10 and 32 is ${sum(10,32)}`);
10
10
@@ -13,8 +13,8 @@ console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
0 commit comments