Skip to content

Commit 5ae319d

Browse files
reset file Sprint-2/2-mandatory-debug/1.js
1 parent a638efe commit 5ae319d

File tree

1 file changed

+5
-15
lines changed
  • Sprint-2/2-mandatory-debug

1 file changed

+5
-15
lines changed

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

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
// Predict and explain first...
22
// =============> write your prediction here
3-
// sure this function wont work because, hang on.. I should predict and pretend that everything is fine
4-
// the function will return with summary of given parameters and console.log will verify it
53

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

11-
// console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
9+
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1210

1311
// =============> write your explanation here
14-
//function will execute line the code and escape from the function block whenever it "sees" return.. it will return with any expression put on it
15-
// in this function a+b which is expected as the result is placed after return line because return has ";" so i wont bother look the next line.
16-
// just remove the semicolon next to the return.. and put a+b instead, because some how "prettier" as trusty worthy formatter for this course will always add extra ; for every logical expression (somehow).. :) xixixixi
1712
// Finally, correct the code to fix the problem
1813
// =============> write your new code here
19-
function sum(a, b) {
20-
return a + b;
21-
}
22-
23-
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

0 commit comments

Comments
 (0)