Skip to content

Commit c5a8edb

Browse files
committed
Answering the task
1 parent 491f9b8 commit c5a8edb

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Predict and explain first...
2-
// =============> write your prediction here
2+
// =============> SyntaxError will occur due to putting a semicolon after return.
33

44
function sum(a, b) {
5-
return;
6-
a + b;
5+
return a + b;
76
}
87

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

11-
// =============> write your explanation here
10+
// =============> unlike the expectation that the code runs without error as 'the sum of 10 and 32 is undefined'.
1211
// Finally, correct the code to fix the problem
1312
// =============> write your new code here
13+
// we needed just to remove the semicolon after return statement and to bring up the a+b expression side by side with return.

0 commit comments

Comments
 (0)