Skip to content

Commit 57a0287

Browse files
committed
comment out the original code and uncomment the correct one
1 parent 3f018a2 commit 57a0287

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • Sprint-3/2-mandatory-debug

‎Sprint-3/2-mandatory-debug/0.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
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)}`);

0 commit comments

Comments
 (0)