File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree 1 file changed +12
-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+ // The function multiply does not return anything, it only logs the result to the console.
5+ // Therefore the outcome of the final console.log will be undefined
6+
47
58function multiply ( a , b ) {
69 console . log ( a * b ) ;
@@ -9,6 +12,15 @@ function multiply(a, b) {
912console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) } ` ) ;
1013
1114// =============> write your explanation here
15+ // The function multiply does not return a value, it only logs the result to the console.
16+ // Therefore on using the template literal to write the result of the function, it doesn't
17+ // have one and renders "undefined" instead
18+
1219
1320// Finally, correct the code to fix the problem
1421// =============> write your new code here
22+ function multiply ( a , b ) {
23+ return a * b ;
24+ }
25+
26+ 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