Skip to content

Commit 0afe2a9

Browse files
solving exercise 2-mandatory-debug 1.js
1 parent c91ef99 commit 0afe2a9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Predict and explain first...
2-
// =============> write your prediction here
2+
// =============> write your prediction here: this code will give an error because the funcion does not return any value and calling it within the consle.log will print undefined.
33

44
function sum(a, b) {
55
return;
@@ -8,6 +8,10 @@ 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+
// =============> write your explanation here : the sum a+b in line 6 should precede the return statement inorder to return the value.
1212
// Finally, correct the code to fix the problem
1313
// =============> write your new code here
14+
15+
// function sum(a, b) {
16+
// return a + b;
17+
// }

0 commit comments

Comments
 (0)