Skip to content

Commit ea78769

Browse files
committed
Added a return to the multiply function
1 parent 7dfcfcd commit ea78769

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Predict and explain first...
22

33
// =============> write your prediction here
4+
//The code will run and print the outcoome of (a * b), however it will have 2 outputs.
5+
// The first output is the console.log(a * b) and the second output will execute the console in line 11.
46

57
function multiply(a, b) {
68
console.log(a * b);
@@ -9,6 +11,12 @@ function multiply(a, b) {
911
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1012

1113
// =============> write your explanation here
12-
14+
// console.log is use to print the instead of return such that the return value can be called at the end.
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)}`);
22+

0 commit comments

Comments
 (0)