Skip to content

Commit a118f95

Browse files
exercise 1 solution mandatory debug
1 parent 651f59e commit a118f95

File tree

1 file changed

+8
-2
lines changed
  • Sprint-2/2-mandatory-debug

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Predict and explain first...
2-
// =============> write your prediction here
2+
// =============> return shouldn't be separated by (;)
33

44
function sum(a, b) {
55
return;
@@ -8,6 +8,12 @@ function sum(a, b) {
88

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

11-
// =============> write your explanation here
11+
// =============> semicolon ends the statement so it wouldn't return anything
1212
// Finally, correct the code to fix the problem
1313
// =============> write your new code here
14+
15+
function sum(a, b) {
16+
return a + b;
17+
}
18+
19+
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

0 commit comments

Comments
 (0)