Skip to content

Commit ac68c4a

Browse files
committed
2-mandatory-debug 0.js
Answered questions and fixed code.
1 parent 8161a89 commit ac68c4a

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

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

33
// =============> write your prediction here
4+
// syntax error as console.log(a, b) cant be part of the function.
45

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

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

1112
// =============> write your explanation here
13+
// I was wrong, it is showing the answer with console.log but giving undefined for the other as the function is incomplete.
1214

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

0 commit comments

Comments
 (0)