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 491f9b8 commit c5a8edbCopy full SHA for c5a8edb
Sprint-2/2-mandatory-debug/1.js
@@ -1,13 +1,13 @@
1
// Predict and explain first...
2
-// =============> write your prediction here
+// =============> SyntaxError will occur due to putting a semicolon after return.
3
4
function sum(a, b) {
5
- return;
6
- a + b;
+ return a + b;
7
}
8
9
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10
11
-// =============> write your explanation here
+// =============> unlike the expectation that the code runs without error as 'the sum of 10 and 32 is undefined'.
12
// Finally, correct the code to fix the problem
13
// =============> write your new code here
+// we needed just to remove the semicolon after return statement and to bring up the a+b expression side by side with return.
0 commit comments