Skip to content

Commit 40f4d05

Browse files
committed
Sprint-2, 2-mandatory-debug, 1.js fixed
1 parent b02c2d9 commit 40f4d05

File tree

1 file changed

+10
-0
lines changed
  • Sprint-2/2-mandatory-debug

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// Predict and explain first...
22
// =============> write your prediction here
3+
// the semicolon after "return" will hamper the return statement because it
4+
// will end the statement before it has been defined what it needs to return.
5+
36

47
function sum(a, b) {
58
return;
@@ -9,5 +12,12 @@ function sum(a, b) {
912
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1013

1114
// =============> write your explanation here
15+
// as above
16+
1217
// Finally, correct the code to fix the problem
1318
// =============> write your new code here
19+
function sum(a, b) {
20+
return a + b;
21+
}
22+
23+
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

0 commit comments

Comments
 (0)