Skip to content

Commit 4ef9f59

Browse files
committed
In 2-Mandatory-debug/1js, the code has been fixed with slight modifcation
1 parent ef668cc commit 4ef9f59

File tree

1 file changed

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

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// Predict and explain first...
2-
// =============> write your prediction here
2+
// =============> The semi colon ; after retunr will results in syntax error.
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 my expectation the code run 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+
14+
// we just need to delete the ; after return and bring a+b side by side as retun a+b;

0 commit comments

Comments
 (0)