Skip to content

Commit c53b3d5

Browse files
committed
Module 2 Sprint 2 Section 2 sub-edited
1 parent 0c81be3 commit c53b3d5

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1313

1414
// =============> write your explanation here
1515
// The function multiply does not return a value, it only logs the result to the console.
16-
// Therefore on using the template literal to write the result of the function, it doesn't
17-
// have one and renders "undefined" instead
16+
// Therefore, on using the template literal to write the result of the function, it doesn't
17+
// have this result and renders "undefined" instead
1818

1919

2020
// Finally, correct the code to fix the problem

Sprint-2/2-mandatory-debug/1.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Predict and explain first...
22
// =============> write your prediction here
3-
// the semicolon after "return" will hamper the return statement because it
4-
// will end the statement before it has been defined what it needs to return.
3+
// the semicolon after "return" will hamper the return statement because this
4+
// character will end the statement before receiving a definition of what it
5+
// needs to return.
56

67

78
function sum(a, b) {

Sprint-2/2-mandatory-debug/2.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
// This program should tell the user the last digit of each number.
2+
// Explain why getLastDigit is not working properly - correct the problem
13
// Predict and explain first...
24

35
// Predict the output of the following code:
46
// =============> Write your prediction here
57
// The "const" is hampering the function getLastDigit because the return
6-
// function will always calculate with the value of the const and ignore any
7-
// other input
8+
// function will always use the value of the const for its calculations and
9+
// ignore any other input
810

911

1012

@@ -20,7 +22,7 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`);
2022

2123
// Now run the code and compare the output to your prediction
2224
// =============> write the output here
23-
//The last digit of 42 is 3
25+
// The last digit of 42 is 3
2426
// The last digit of 105 is 3
2527
// The last digit of 806 is 3
2628

@@ -41,5 +43,3 @@ console.log(`The last digit of 42 is ${getLastDigit(42)}`);
4143
console.log(`The last digit of 105 is ${getLastDigit(105)}`);
4244
console.log(`The last digit of 806 is ${getLastDigit(806)}`);
4345

44-
// This program should tell the user the last digit of each number.
45-
// Explain why getLastDigit is not working properly - correct the problem

0 commit comments

Comments
 (0)