You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-3/2-mandatory-debug/1.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,10 @@
8
8
9
9
//console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10
10
//console output: The sum of 10 and 32 is undefined
11
-
// The return statement was placed before the calculation the code on line 6 doesn't get executed as return ends the function on line 5. The function would need to return a+b in order for it to return the result.
12
-
11
+
//The return statement was placed before the calculation the code on line 6 doesn't get executed as return ends the function on line 5. The function would need to return a+b in order for it to return the result.
13
12
//Finally, correct the code to fix the problem
14
13
15
14
functionsum(a,b){
16
-
returna+b;
15
+
returna+b;
17
16
}
18
17
console.log(`The sum of 10 and 32 is ${sum(10,32)}`);
0 commit comments