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 7f385a8 commit 64baf41Copy full SHA for 64baf41
Sprint-2/2-mandatory-debug/1.js
@@ -1,13 +1,22 @@
1
// Predict and explain first...
2
// =============> write your prediction here
3
+//will log "the sum....undefined"
4
-function sum(a, b) {
5
- return;
6
- a + b;
7
-}
+// function sum(a, b) {
+// return;
+// 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
+//the ; in the function stops the return from reading a*b
14
+
15
// Finally, correct the code to fix the problem
16
// =============> write your new code here
17
18
+function sum(a, b) {
19
+ return a + b;
20
+}
21
22
+console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
0 commit comments