Skip to content

Commit d449428

Browse files
committed
manadatory debug 1.js
1 parent d63b3d3 commit d449428

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
// Predict and explain first...
2-
// =============> write your prediction here
1+
// Predict and explain first... function doesn't return anything, so the result of multiplying 10 and 32 is undefined.
2+
// To fix this, we should add a return statement to the function to return the result of multiplying a and b.
3+
// =============> write your prediction here 'The sum of 10 and 32 is undefined'
34

4-
function sum(a, b) {
5-
return;
6-
a + b;
7-
}
5+
//function sum(a, b) {
6+
//return;
7+
//a + b;
8+
//}
89

9-
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10+
//console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1011

1112
// =============> write your explanation here
1213
// Finally, correct the code to fix the problem
1314
// =============> write your new code here
15+
function sum(a, b) {
16+
return a + b;
17+
}
18+
19+
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

0 commit comments

Comments
 (0)