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 985cde4 commit da968b7Copy full SHA for da968b7
Sprint-2/2-mandatory-debug/1.js
@@ -1,13 +1,27 @@
1
// Predict and explain first...
2
// =============> write your prediction here
3
+/**
4
+ * It returns an "undefined"
5
+ */
6
-function sum(a, b) {
7
+/** function sum(a, b) {
8
return;
9
a + b;
10
}
11
12
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
13
+*/
14
15
// =============> write your explanation here
16
+ /** Explanation:
17
+ * The arguments "a + b" should be on the same line as the return so the sum returns that value instead of "undefined"
18
19
+
20
// Finally, correct the code to fix the problem
21
// =============> write your new code here
22
+function sum(a, b) {
23
+ return a + b;
24
+}
25
26
+console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
27
0 commit comments