Skip to content

Commit 2d4152e

Browse files
committed
Solved task 2-mandatory-debug/0.js
1 parent ea085d9 commit 2d4152e

File tree

1 file changed

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

1 file changed

+7
-4
lines changed

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

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

3-
// =============> write your prediction here
3+
// =============> I think the result will be undefined because in the function there is no return statement.
44

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

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

11-
// =============> write your explanation here
11+
// =============> Its interesting - function log the result but doesn't return it. So when we see the output 320 and "undefined"
1212

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

0 commit comments

Comments
 (0)