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 any value, it only logs the product of a and b to the console.
5+ Therefore, when we try to log the result of multiply(10, 32), it will log 'undefined' because the
6+ function does not return anything.*/
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
17+ // The function multiply does not have a return statement, so it returns undefined by default.
1218
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+
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