Skip to content

Commit 7f385a8

Browse files
author
kohanman
committed
Sprint 2 | Coursework 2.0
1 parent 58865b6 commit 7f385a8

File tree

1 file changed

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

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
// Predict and explain first...
2+
//the function doesnt return anything so it will just display a*b (320)
3+
// and the message "the result of.....'undefined'"
24

35
// =============> write your prediction here
46

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

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

1113
// =============> write your explanation here
14+
//the function doesnt return anything it just performs console log using the same a and b variables
1215

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

0 commit comments

Comments
 (0)