Skip to content

Commit 7fc8853

Browse files
committed
Comment out the sum function and console log for debugging purposes
1 parent 2d81e8b commit 7fc8853

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
// The code seems like it would log 'The sum of 10 and 32 is 42' since function 'sum(10, 32)' seems to add two numbers
44

55

6-
function sum(a, b) {
7-
return;
8-
a + b;
9-
}
6+
// function sum(a, b) {
7+
// return;
8+
// a + b;
9+
// }
1010

11-
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
11+
// console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1212

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

0 commit comments

Comments
 (0)