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 903614e commit 7fadd53Copy full SHA for 7fadd53
1 file changed
Sprint-2/2-mandatory-debug/1.js
@@ -1,13 +1,21 @@
1
// Predict and explain first...
2
// =============> write your prediction here
3
+// Martin response - I expect this to return a blank value as there is a return statement, with no expression;
4
5
function sum(a, b) {
6
return;
7
a + b;
8
}
9
-console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10
+// console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
11
12
// =============> write your explanation here
13
+// Martin response - the value returned is undefined because the return statement is return with no expression;
14
// Finally, correct the code to fix the problem
15
// =============> write your new code here
16
+
17
+function sum(a, b) {
18
+ return a + b;
19
+}
20
21
+console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
0 commit comments