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
// the console will show The sum of 10 and 32 is undefined, this is because the return command is before the calculation so the return has no value to bring back.
3
4
4
-
functionsum(a,b){
5
-
return;
6
-
a+b;
7
-
}
5
+
//function sum(a, b) {
6
+
// return;
7
+
// a + b;
8
+
//}
8
9
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)}`);
10
11
11
12
// =============> write your explanation here
13
+
//the console will show The sum of 10 and 32 is undefined, this is because the return command is before the calculation so the return has no value to bring back.
12
14
// Finally, correct the code to fix the problem
13
15
// =============> write your new code here
16
+
functionsum(a,b){
17
+
returna+b;
18
+
}
19
+
20
+
console.log(`The sum of 10 and 32 is ${sum(10,32)}`);
0 commit comments