Skip to content

Commit 49726c9

Browse files
committed
2-mandatory-debug 1.js
Answered questions and fixed code.
1 parent ac68c4a commit 49726c9

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
// Predict and explain first...
22
// =============> write your prediction here
3+
// Going to show undefined
34

4-
function sum(a, b) {
5-
return;
6-
a + b;
7-
}
5+
// function sum(a, b) {
6+
// return;
7+
// a + b;
8+
// }
89

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

1112
// =============> write your explanation here
13+
// the code is not doing the sum needed of a + b as they are just split by the ; ,
14+
1215
// Finally, correct the code to fix the problem
1316
// =============> write your new code here
17+
18+
function sum(a, b) {
19+
return a + b;
20+
}

0 commit comments

Comments
 (0)