Skip to content

Commit 4bf3376

Browse files
committed
Completed 1.js exercise
1 parent 01dccfc commit 4bf3376

File tree

1 file changed

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

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Predict and explain first...
22
// =============> write your prediction here
33

4+
// It will not say `undefined` but will not add parameter `a` and `b`
5+
46
function sum(a, b) {
57
return;
68
a + b;
@@ -9,5 +11,12 @@ function sum(a, b) {
911
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1012

1113
// =============> write your explanation here
14+
15+
// The console prints: The sum of 10 and 32 is undefined
16+
1217
// Finally, correct the code to fix the problem
1318
// =============> write your new code here
19+
20+
function add(a, b) {
21+
return a + b;
22+
}

0 commit comments

Comments
 (0)