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
// =============> return is not followed by anything (directly), and a+b is after the ";" after return. in a function nothing gets executed after return
3
3
4
4
functionsum(a,b){
5
5
return;
@@ -8,6 +8,11 @@ function sum(a, b) {
8
8
9
9
console.log(`The sum of 10 and 32 is ${sum(10,32)}`);
10
10
11
-
// =============> write your explanation here
11
+
// =============> return value is undefined, so in the console log sentence the result (return value) is substituted with "undefined" instead of the actual sum
12
12
// Finally, correct the code to fix the problem
13
13
// =============> write your new code here
14
+
functionsum(a,b){
15
+
returna+b;
16
+
}
17
+
18
+
console.log(`The sum of 10 and 32 is ${sum(10,32)}`);
0 commit comments