File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
22
3- // =============> write your prediction here
3+ // I predict that the code will output the result of the multiplication, but the function multiply will not return a value.
4+
5+ // this function should multiply two numbers and return the result
6+
47
58function multiply ( a , b ) {
69 console . log ( a * b ) ;
@@ -10,5 +13,13 @@ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1013
1114// =============> write your explanation here
1215
16+ // The function multiply is using console.log to output the result of the multiplication, but it is not returning a value.
17+ // Therefore, the template literal will not be able to access the result of the multiplication.
18+
1319// Finally, correct the code to fix the problem
1420// =============> write your new code here
21+
22+ function multiply ( a , b ) {
23+ return a * b ;
24+ }
25+ console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) } ` ) ;
You can’t perform that action at this time.
0 commit comments