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 code needs a value inside the console.log function to multiply, but no value was useed to replace the placeholder parameters
4
+
// It should be an error, no value to return
2
5
3
6
// =============> write your prediction here
4
7
5
-
functionmultiply(a,b){
6
-
console.log(a*b);
7
-
}
8
+
// function multiply(a, b) {
9
+
// console.log(a * b);
10
+
// }
11
+
// console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
8
12
9
-
console.log(`The result of multiplying 10 and 32 is ${multiply(10,32)}`);
10
13
11
14
// =============> write your explanation here
15
+
// Answer below:
16
+
// The code has two function parameters, it prints the parameters without an actual value. To correct this code the console.log has to be replaced with retun
17
+
// To return the value of the parameters when called
12
18
13
19
// Finally, correct the code to fix the problem
14
20
// =============> write your new code here
21
+
22
+
functionmultiply(a,b){
23
+
returna*b
24
+
}
25
+
console.log(`The result of multiplying 10 and 32 is ${multiply(10,10)}`);
0 commit comments