Skip to content

Commit 60f078f

Browse files
committed
mandatory error 1.1
1 parent 84683b4 commit 60f078f

File tree

1 file changed

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

1 file changed

+12
-7
lines changed

Sprint-2/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+
// =============> write your prediction here: There is a semi column on line 5 after the return which separates it from line 6. We don't know what we are returning.
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+
// =============> write your explanation here: SInce we don't know what we are returning, we will get an undefined value for the function.
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)