Skip to content

Commit d63b3d3

Browse files
committed
manadatory debug 0.js
1 parent 3f94fb8 commit d63b3d3

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
// Predict and explain first...
1+
// Predict and explain first...didn't declare the a and b parameters in the function. This will cause a ReferenceError. To fix this, we should declare the parameters a and b in the function definition.
22

3-
// =============> write your prediction here
3+
// =============> write your prediction here function doesn't return anything, so the result of multiplying 10 and 32 is undefined.
4+
// To fix this, we should add a return statement to the function to return the result of multiplying a and b.
45

5-
function multiply(a, b) {
6-
console.log(a * b);
7-
}
6+
//function multiply(a, b) {
87

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

11-
// =============> write your explanation here
13+
// =============> The result of multiplying 10 and 32 is undefined'write your explanation here
1214

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

0 commit comments

Comments
 (0)