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
// Predict and explain first...didn't declare the a and b parameters in the function. This will cause a ReferenceError. To fix this, we should declare the parameters a and b in the function definition.
2
2
3
-
// =============> write your prediction here
3
+
// =============> write your prediction here function doesn't return anything, so the result of multiplying 10 and 32 is undefined.
4
+
// To fix this, we should add a return statement to the function to return the result of multiplying a and b.
4
5
5
-
functionmultiply(a,b){
6
-
console.log(a*b);
7
-
}
6
+
//function multiply(a, b) {
8
7
9
-
console.log(`The result of multiplying 10 and 32 is ${multiply(10,32)}`);
8
+
//console.log(a * b);
9
+
//}
10
+
11
+
//console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
10
12
11
-
// =============> write your explanation here
13
+
// =============> The result of multiplying 10 and 32 is undefined'write your explanation here
12
14
13
15
// Finally, correct the code to fix the problem
14
16
// =============> write your new code here
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