You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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
5
3
6
-
// function sum(a, b) {
7
-
// return;
8
-
// a + b;
9
-
// }
4
+
functionsum(a,b){
5
+
return;
6
+
a+b;
7
+
}
10
8
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)}`);
12
10
13
11
// =============> 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
17
12
// Finally, correct the code to fix the problem
18
13
// =============> write your new code here
19
-
functionsum(a,b){
20
-
returna+b;
21
-
}
22
-
23
-
console.log(`The sum of 10 and 32 is ${sum(10,32)}`);
0 commit comments