File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
22
33// =============> write your prediction here
4+ /**
5+ * It display "320" and "The result of multiplying 10 and 32 is undefined"
6+ */
47
8+ /**
59function multiply(a, b) {
610 console.log(a * b);
711}
812
913console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
14+ */
1015
1116// =============> write your explanation here
1217
18+ /** Explanation:
19+ *
20+ * The following function takes two arguments a and b as input and display the multiplication result.
21+ * But instead of using the function "console.log" it shoudl use the function "return (a * b)".
22+ * That's the reason it displays "undefined".
23+ */
24+
1325// Finally, correct the code to fix the problem
1426// =============> write your new code here
27+
28+ function multiply ( a , b ) {
29+ return a * b ;
30+ }
31+
32+ console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) } ` ) ;
33+
You can’t perform that action at this time.
0 commit comments