We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8cebbb commit a5bdca3Copy full SHA for a5bdca3
Sprint-2/2-mandatory-debug/1.js
@@ -1,13 +1,19 @@
1
// Predict and explain first...
2
// =============> write your prediction here
3
+// there is an error on line 5 and 6
4
+//function sum(a, b) {
5
+// //return;
6
+// a + b;
7
+// }
8
-function sum(a, b) {
- return;
- a + b;
-}
-
9
-console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
+// console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10
11
// =============> write your explanation here
12
+//the return statement is not returning any value. a+b declared after return.
13
// Finally, correct the code to fix the problem
14
// =============> 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