Skip to content

Commit 4cdfdd4

Browse files
committed
explained the technical error and fixed the code as comment.
1 parent 5e632d2 commit 4cdfdd4

File tree

1 file changed

+6
-2
lines changed
  • Sprint-2/2-mandatory-debug

1 file changed

+6
-2
lines changed

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

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

3-
// =============> write your prediction here
3+
// =============> write your prediction here: the value of a and b is not defined in the function and the return statement is missing.//
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 code is running but it has technical issue. the multiply function logs the result but does not return it.We need to use return function to use the result inside the string.//
1212

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

0 commit comments

Comments
 (0)