Skip to content

Commit b3a0d25

Browse files
Update comments to clarify function purpose and expected behavior
1 parent dab62aa commit b3a0d25

File tree

1 file changed

+9
-4
lines changed
  • Sprint-2/2-mandatory-debug

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
// Predict and explain first...
1+
// Predict and explain first: This function is supposed to multiply two numbers and return the result.
22

3-
// =============> write your prediction here
3+
// =============> write your prediction here : The result will be the multiplication of the two numbers.
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+
// =============> write your explanation here : The function is logging the result of the console.log statement
12+
// but it is not returning any value. That's because we are using console.log instead of return in the function.
1213

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

0 commit comments

Comments
 (0)