Skip to content

Commit 6b32611

Browse files
committed
task 1.js mandatory error completed
1 parent 5839e8d commit 6b32611

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

  • Sprint-3/2-mandatory-debug

‎Sprint-3/2-mandatory-debug/1.js‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
// Predict and explain first...
22
// =============> write your prediction here
3+
// Code will not work because the paremeters should be on same line as return
34

4-
function sum(a, b) {
5-
return;
6-
a + b;
7-
}
5+
// function sum(a, b) {
6+
// return;
7+
// a + b;
8+
// }
89

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)}`);
1011

1112
// =============> write your explanation here
13+
// The errors in this codes is the semi-colon in front of the return and the placeholder parameters not on same line as the return
1214
// Finally, correct the code to fix the problem
1315
// =============> 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

Comments
 (0)