File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
22
33// =============> write your prediction here
4-
4+ // It will show a undefined error
55function multiply ( a , b ) {
66 console . log ( a * b ) ;
77}
88
9- console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) } ` ) ;
9+ console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) }
1010
1111// =============> write your explanation here
12-
12+ // The function printed the answer but did't return it, so when it was used in the template string, it came out as 'undefined.'
1313// Finally, correct the code to fix the problem
1414// =============> write your new code here
15+ function multiply(a, b) {
16+ return a * b; // Once I put a * b on the same line as return, it worked
17+ }
18+
19+ console.log(` The sum of 10 and 32 is ${sum ( 10 , 32 ) } `) ;
20+
You can’t perform that action at this time.
0 commit comments