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 f7173fc commit 9bfd01aCopy full SHA for 9bfd01a
Sprint-2/2-mandatory-debug/1.js
@@ -1,13 +1,18 @@
1
// Predict and explain first...
2
-// =============> write your prediction here
+// SyntaxError
3
4
+// function sum(a, b) {
5
+// return;
6
+// a + b;
7
+// }
8
+
9
+// console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10
11
+// the function doesn't return anything because there is ";" immediately after "return" and the mathematicall operation is on another line
12
+// Finally, correct the code to fix the problem
13
function sum(a, b) {
- return;
- a + b;
14
+ return a + b;
15
16
}
17
18
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
-
-// =============> write your explanation here
-// Finally, correct the code to fix the problem
-// =============> write your new code here
0 commit comments