Skip to content

Commit f65ea9e

Browse files
committed
Updated comments and added return statement in multiply function
1 parent 9f55529 commit f65ea9e

File tree

1 file changed

+8
-3
lines changed
  • Sprint-2/2-mandatory-debug

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
// Predict and explain first...
22

3-
// =============> write your prediction here
3+
// =============> there is no return statement, therefore, you cannot use the result of the function in a console log. The function will run but it will return undefined.
44

55
function multiply(a, b) {
66
console.log(a * b);
77
}
88

99
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1010

11-
// =============> write your explanation here
11+
// =============> you need to add a return statement in order to use the result and so it can be displayed on the console.
1212

1313
// Finally, correct the code to fix the problem
14-
// =============> write your new code here
14+
// =============>
15+
function multiply(a, b) {
16+
return a * b;
17+
}
18+
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
19+

0 commit comments

Comments
 (0)