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 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
You can’t perform that action at this time.
0 commit comments