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 5e85fd2 commit 39b4b88Copy full SHA for 39b4b88
Sprint-2/2-mandatory-debug/1.js
@@ -1,13 +1,25 @@
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
+ /** The arguments "a + b" should be on the same line as the return so the sum returns that value instead of "undefined"
17
18
+
19
// Finally, correct the code to fix the problem
20
// =============> write your new code here
21
+function sum(a, b) {
22
+ return a + b;
23
+}
24
25
+console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
0 commit comments