File tree Expand file tree Collapse file tree
Sprint-3/2-mandatory-debug Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Predict and explain first...
22
3- // =============> write your prediction here
3+ // =============> write your prediction here:
4+ //The code will run, but the output won't be what we expect because the multiply function logs the result instead of returning it.
45
56function multiply ( a , b ) {
67 console . log ( a * b ) ;
78}
89
910console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) } ` ) ;
1011
11- // =============> write your explanation here
12-
12+ // =============> write your explanation here:console.log(a * b);
13+ //The result is 320, but the function doesn't return a value. It shows us undefined because we don't have return in the function.
14+ //320
15+ //The result of multiplying 10 and 32 is undefined
1316// Finally, correct the code to fix the problem
14- // =============> write your new code here
17+ // =============> write your new code here:
18+ function multiply ( a , b ) {
19+ return a * b ;
20+ }
21+
22+ 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