Skip to content

Commit 5839e8d

Browse files
committed
task mandatory-debug completed
1 parent fb14e2c commit 5839e8d

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
// Predict and explain first...
2+
// Answer below:
3+
// The code needs a value inside the console.log function to multiply, but no value was useed to replace the placeholder parameters
4+
// It should be an error, no value to return
25

36
// =============> write your prediction here
47

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

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

1114
// =============> write your explanation here
15+
// Answer below:
16+
// The code has two function parameters, it prints the parameters without an actual value. To correct this code the console.log has to be replaced with retun
17+
// To return the value of the parameters when called
1218

1319
// Finally, correct the code to fix the problem
1420
// =============> write your new code here
21+
22+
function multiply(a, b) {
23+
return a * b
24+
}
25+
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 10)}`);

0 commit comments

Comments
 (0)