Skip to content

Commit a243d6d

Browse files
2-mandatory-debug 1.jsedited, expectation stated, code fixed
1 parent bc68642 commit a243d6d

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
// Predict and explain first...
2-
// =============> write your prediction here
2+
// =============> I predict a SyntaxError in original code
33

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

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

11-
// =============> write your explanation here
11+
// =============> Expression a + b is not assigned to return.
1212
// Finally, correct the code to fix the problem
1313
// =============> write your new code here
14+
function sum(a, b) {
15+
return (a+b);
16+
}
17+
18+
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

0 commit comments

Comments
 (0)