Skip to content

Commit 0b216d5

Browse files
committed
Solved task 2-mandatory-debug/1.js
1 parent 2d4152e commit 0b216d5

File tree

1 file changed

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

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Predict and explain first...
2-
// =============> write your prediction here
2+
// =============> I guess that the output will be undefined because there is a semicolon after the "return" and this breaks the line of code, and after return statement nothing can be returned
33

44
function sum(a, b) {
55
return;
@@ -8,6 +8,8 @@ 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+
// =============> The output is "The sum of 10 and 32 is undefined" as I predicted above
1212
// Finally, correct the code to fix the problem
13-
// =============> write your new code here
13+
// =============> function sum(a, b) {
14+
// return a + b;
15+
// }

0 commit comments

Comments
 (0)