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
Copy file name to clipboardExpand all lines: Sprint-2/2-mandatory-debug/0.js
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,23 @@
1
1
// Predict and explain first...
2
2
3
-
// =============> write your prediction here
3
+
// =============> write your prediction here: there will be an error, due to console.log being used incorrectly. Console.log is for displaying but there is no return command to
4
+
//clarify what to send to console.log
5
+
6
+
//function multiply(a, b) {
7
+
// console.log(a * b);
8
+
//}
9
+
10
+
//console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
11
+
12
+
// =============> write your explanation here: I have run the code on node.js and got 'undefined' as an error message. I shall add 'return' instead of the first 'console.log'
13
+
//so that the result can be displayed properly in the second console.log.
14
+
15
+
// Finally, correct the code to fix the problem
16
+
// =============> write your new code here:
4
17
5
18
functionmultiply(a,b){
6
-
console.log(a*b);
19
+
returna*b;
7
20
}
8
21
9
22
console.log(`The result of multiplying 10 and 32 is ${multiply(10,32)}`);
0 commit comments