Skip to content

Commit 2d81e8b

Browse files
committed
Add explanation for sum function bug and unreachable code
1 parent b89e5b7 commit 2d81e8b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ function sum(a, b) {
1111
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1212

1313
// =============> write your explanation here
14+
// When the code was run it logged 'The sum of 10 and 32 is undefined'
15+
// The bug is in line 7
16+
// 'return' is automatically assigned a semi-colon if it is followed by a line break, making line 8 unreachable
1417
// Finally, correct the code to fix the problem
1518
// =============> write your new code here

0 commit comments

Comments
 (0)