Skip to content

Commit 3923291

Browse files
committed
editted the prediction(wrote prediction and explanation in the same line) and wrote the code
1 parent b4c7cf2 commit 3923291

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Predict and explain first...
2-
// =============> what does return value going to give out?,the expression is written after return.
2+
// =============> return value is written before the expression.
33

44
function sum(a, b) {
55
return;
@@ -8,6 +8,13 @@ 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+
// =============> when the expression evaluates a value it will
12+
// need a return statment,but the return statment is before the expression
13+
// which will result in undefined outcome because the function that is passing
14+
// an argument is not receiving output of the expression.
1215
// Finally, correct the code to fix the problem
13-
// =============> write your new code here
16+
//
17+
// function sum(a, a){
18+
// return a+b;
19+
//}
20+
// console.log(`the sum of 10 and 32 is ${sum(10,32)}`);

0 commit comments

Comments
 (0)