Skip to content

Commit 01dccfc

Browse files
committed
Completed 0.js exercise
1 parent f342a4c commit 01dccfc

File tree

1 file changed

+11
-0
lines changed
  • Sprint-2/2-mandatory-debug

1 file changed

+11
-0
lines changed

Sprint-2/2-mandatory-debug/0.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
// =============> write your prediction here
44

5+
// The function prints to the console by multiplying the parameter `a` and `b`
6+
57
function multiply(a, b) {
68
console.log(a * b);
79
}
@@ -10,5 +12,14 @@ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1012

1113
// =============> write your explanation here
1214

15+
// I missed line 11, the function does indeed prints to the console but returns nothing
16+
// which explains `undefined` in the string interpolation of the function
17+
1318
// Finally, correct the code to fix the problem
1419
// =============> write your new code here
20+
21+
function product(a, b) {
22+
const result = a * b;
23+
console.log(result)
24+
return result;
25+
}

0 commit comments

Comments
 (0)