File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
22
3- // =============> write your prediction here
3+ // =============> The funtion does not return a value, so when we try to log the result of the function call,
4+ // it will return undefined and log "The result of multiplying 10 and 32 is undefined" to the console.
45
5- function multiply ( a , b ) {
6- console . log ( a * b ) ;
7- }
6+ // function multiply(a, b) {
7+ // console.log(a * b);
8+ // }
89
9- console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) } ` ) ;
10+ // console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1011
11- // =============> write your explanation here
12+ // =============> 320 The result of multiplying 10 and 32 is undefined
1213
1314// Finally, correct the code to fix the problem
1415// =============> write your new code here
16+
17+ function multiply ( a , b ) {
18+ return a * b ;
19+ }
20+
21+ 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