There was an error while loading. Please reload this page.
1 parent 6018cd5 commit 444757fCopy full SHA for 444757f
1 file changed
Sprint-3/2-mandatory-debug/1.js
@@ -1,6 +1,8 @@
1
// Predict and explain first...
2
// =============> write your prediction here
3
4
+// it will return syntax error
5
+
6
function sum(a, b) {
7
return;
8
a + b;
@@ -9,5 +11,16 @@ function sum(a, b) {
9
11
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10
12
13
// =============> write your explanation here
-// Finally, correct the code to fix the problem
14
15
+// There is a semicolon after return.
16
17
+// Finally, correct the code to fix the problem.
18
+// Later I discovered having a line between return and a + b gives another undefined error message
19
// =============> write your new code here
20
21
+function sum(a, b) {
22
+ return a + b;
23
+}
24
25
+console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
26
0 commit comments