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
{{ message }}
Repository navigation
Commit 8b3c3ff
Browse filesBrowse the repository at this point in the historyBrowse files
//the function will add the values stored in the parameter.
4
+
2
5
// =============> write your prediction here
3
6
4
-
functionsum(a,b){
5
-
return;
6
-
a+b;
7
-
}
7
+
// function sum(a, b) {
8
+
// return;
9
+
// a + b;
10
+
// }
8
11
9
-
console.log(`The sum of 10 and 32 is ${sum(10,32)}`);
12
+
// console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
10
13
11
14
// =============> write your explanation here
15
+
//created a function called sum with two parameters, and from adequate research i have learned that the return and the values have to be on the same line otherwise it tells JavaScript to stop the function at return before reaching a + b.
12
16
// Finally, correct the code to fix the problem
13
17
// =============> write your new code here
18
+
19
+
functionsum(a,b){
20
+
returna+b;
21
+
}
22
+
console.log(`The sum of 10 and 32 is ${sum(10,32)}`);
0 commit comments