Skip to content

Commit 63539e9

Browse files
committed
change console.log to return in sprint 3 key error 3
1 parent c937b63 commit 63539e9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

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

3-
// =============> write your prediction here
3+
// Prediction:I think it will print 320, but the template string might not show the right result, but will return nothing.
44

55
function multiply(a, b) {
6-
console.log(a * b);
6+
return a * b;
77
}
88

99
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1010

11-
// =============> write your explanation here
11+
// because console.log will print whatever it is given .
12+
// the function has no return statement, so when we run the code it will say undefined because there is nothing to give back.
1213

1314
// Finally, correct the code to fix the problem
1415
// =============> write your new code here

0 commit comments

Comments
 (0)