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
// When the code is run the product of a and b will be logged to the console however the console log portion that relates to the function call will show undefined because the function doesn't return anything
4
5
5
-
functionmultiply(a,b){
6
-
console.log(a*b);
7
-
}
6
+
// function multiply(a, b) {
7
+
// console.log(a * b);
8
+
// }
8
9
9
-
console.log(`The result of multiplying 10 and 32 is ${multiply(10,32)}`);
10
+
// console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
10
11
11
12
// =============> write your explanation here
12
-
13
+
// As the function has no return statement it returns undefined by default.
13
14
// Finally, correct the code to fix the problem
14
15
// =============> write your new code here
16
+
17
+
functionmultiply(a,b){
18
+
returna*b;
19
+
}
20
+
21
+
console.log(`The result of multiplying 10 and 32 is ${multiply(10,32)}`);
0 commit comments