Skip to content

Commit dd973e6

Browse files
committed
Revert "Fix multiply function to return result and log output"
This reverts commit 5809aee.
1 parent ce5e2ad commit dd973e6

File tree

1 file changed

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

1 file changed

+3
-15
lines changed

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

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

3-
// =============> the function when called will throw an error
3+
// =============> write your prediction here
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-
// =============> the function multiply has no return statement
11+
// =============> write your explanation here
1212

1313
// Finally, correct the code to fix the problem
14-
// =============>
15-
function multiply(a, b) {
16-
return (a * b); // we change the console.log statement with the return statement
17-
}
18-
19-
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
20-
21-
// an extra notice: the purpose of creating a function is to reuse it when needed
22-
// I've noticed that the parameters are already assigned to values 10 and 32, so I changed the code to the following:
23-
function multiply(a, b) {
24-
return console.log(`The result of multiplying ` + a +` and ` + b +` is ` + (a * b));
25-
}
26-
multiply(10, 32);
14+
// =============> write your new code here

0 commit comments

Comments
 (0)