Skip to content

Commit 468a49f

Browse files
committed
1.js updated pr template
1 parent ca2b713 commit 468a49f

File tree

1 file changed

+7
-0
lines changed
  • Sprint-2/2-mandatory-debug

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Predict and explain first...
22
// =============> write your prediction here
3+
// there will be an error because return should not have semicolon which is the end of the declaration and a+b should be with it together.
34

45
function sum(a, b) {
56
return;
@@ -9,5 +10,11 @@ function sum(a, b) {
910
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1011

1112
// =============> write your explanation here
13+
// it is undefined because it stopped reading at return;
1214
// Finally, correct the code to fix the problem
1315
// =============> write your new code here
16+
function sum(a, b) {
17+
return a + b;
18+
}
19+
20+
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

0 commit comments

Comments
 (0)