Skip to content

Commit 9aadee0

Browse files
author
russom
committed
Predict, explain and fix code
1 parent 6f4e46f commit 9aadee0

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,23 @@
22

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

5-
function multiply(a, b) {
5+
// 'The result of multiplying 10 and 32 is 10 * 32' is printed.
6+
7+
/*function multiply(a, b) {
68
console.log(a * b);
79
}
810
9-
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
11+
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);*/
1012

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

15+
// the function prints a * b. When presented with multiply(10, 32) it prints 10 * 32.
16+
1317
// Finally, correct the code to fix the problem
1418
// =============> write your new code here
19+
20+
function multiply(a, b) {
21+
return (a * b);
22+
}
23+
24+
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);

0 commit comments

Comments
 (0)