Skip to content

Commit 3d69494

Browse files
Fix return statement placement in sum function
Moved the return statement to after the addition operation to ensure the function returns the correct result.
1 parent 1712038 commit 3d69494

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

  • Sprint-2/2-mandatory-debug

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1313
// =============> the explanation:
1414
// The function sum has a return statement before the addition operation, which causes the function to return undefined immediately.
1515
// To fix this, the return statement should be placed after the addition operation.
16-
// because the function is not a string i have to remove the backticks and use a normal string concatenation to print the result correctly.
1716
// Finally, correct the code to fix the problem
1817
// =============> write your new code here
1918
function sum(a, b) {

0 commit comments

Comments
 (0)