Skip to content

Commit b06efe8

Browse files
committed
defined the result of multiplying
1 parent 2c78497 commit b06efe8

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
// Predict and explain first...
2+
// the function will multiply the values stored in the parameter. within the function scope the console.log, logs the answer but it does not return one.
23

34
// =============> write your prediction here
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

1112
// =============> write your explanation here
1213

14+
//first step creates a function called multiply with two parameters
15+
//Then we would have to call the function, and still within the function scope we have to write return so we can get the result back.
16+
//console.log then runs the code to put the result in the right place
17+
1318
// Finally, correct the code to fix the problem
1419
// =============> write your new code here
20+
21+
function multiply(a, b) {
22+
return a * b;
23+
}
24+
console.log(`The result of multiplyig 10 and 32 is ${multiply(10, 32)}`);

0 commit comments

Comments
 (0)