Skip to content

Commit 9a6d44e

Browse files
authored
Fix sum function to return correct sum
Fixed the sum function to return the correct result by including the addition operation in the return statement.
1 parent 1fb3330 commit 9a6d44e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • Sprint-2/2-mandatory-debug

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ function sum(a, b) {
88

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

11+
// [ChunYanWong]
12+
// The sum of 10 and 32 is undefined
13+
1114
// =============> write your explanation here
15+
// [ChunYanWong] a+b should be included in the return statement
16+
1217
// Finally, correct the code to fix the problem
1318
// =============> write your new code here
19+
// [ChunYanWong] return (a+b);

0 commit comments

Comments
 (0)