Skip to content

Commit 2b62802

Browse files
consoled log the function and further explained my prediction and the results
1 parent c6908db commit 2b62802

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

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

33
// =============> write your prediction here
4-
// This function would multiply the two arguments a and b whatever that is
4+
// This function would multiply the two arguments a and b
55
// when we log the output we will get the string and the output of the function but because we are not returning an output we might run into an error
66

77
// function multiply(a, b) {
@@ -11,12 +11,15 @@
1111
// console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1212

1313
// =============> write your explanation here
14-
//The console.log() inside the funtion will print a*b but when we call the function will return undefined
14+
//The console.log() inside the function will print a*b but when we call the function will return the out put and undefined
15+
// but after the fix of returning instead it will be working giving the result in that instance will get 320
1516

1617
// Finally, correct the code to fix the problem
1718
// =============> write your new code here
1819
function multiply(a, b) {
1920
return a * b;
2021
}
2122

22-
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
23+
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
24+
25+
console.log(multiply(10,32))

0 commit comments

Comments
 (0)