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 33// =============>
44// Variables haven't been declared, so it will throw a reference error
55
6- function multiply ( a , b ) {
6+ /* function multiply(a, b) {
77 console.log(a * b);
88}
99
10- console . log ( `The result of multiplying 10 and 32 is ${ multiply ( 10 , 32 ) } ` ) ;
11-
10+ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); */
1211// =============> write your explanation here
1312// It printed 32 because that particular console function is inside the multiply function (local), whereas the other one
1413// is outside the scope and when we call the multiply function it comes up as undefined because nothing has been returned
1514// inside of it.
1615// Finally, correct the code to fix the problem
1716// =============> write your new code here
1817
19- /* function multiply(a, b) {
18+ function multiply ( a , b ) {
2019 return a * b ;
2120}
22- console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); */
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