Skip to content

Commit fe28db6

Browse files
committed
made the first code and run and checked the newcode, displayed the outcome.
1 parent 96440cb commit fe28db6

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
// so it means it is not using the argument that is passed by the function.
66
// the output for the three of function calls will be 3.
77

8-
const num = 103;
8+
//const num = 103;
99

10-
function getLastDigit() {
11-
return num.toString().slice(-1);
12-
}
10+
//function getLastDigit() {
11+
//return num.toString().slice(-1);
12+
//}
1313

14-
console.log(`The last digit of 42 is ${getLastDigit(42)}`);
15-
console.log(`The last digit of 105 is ${getLastDigit(105)}`);
16-
console.log(`The last digit of 806 is ${getLastDigit(806)}`);
14+
//console.log(`The last digit of 42 is ${getLastDigit(42)}`);
15+
//console.log(`The last digit of 105 is ${getLastDigit(105)}`);
16+
//console.log(`The last digit of 806 is ${getLastDigit(806)}`);
1717

1818
// Now run the code and compare the output to your prediction
1919
// =============> write the output here
@@ -41,4 +41,8 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`);
4141

4242

4343
// This program should tell the user the last digit of each number.
44+
// yes it does tell the last digit of each number
45+
// The last digit of 42 is 2
46+
// The last digit of 105 is 5
47+
// The last digit of 806 is 6
4448
// Explain why getLastDigit is not working properly - correct the problem

0 commit comments

Comments
 (0)