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 1- // Predict and explain first
1+ // Predict and explain first
22// As per the code output should be the last digits of the given number .
33
44// Predict the output of the following code:
2727// Finally, correct the code to fix the problem
2828// =============> write your new code here
2929function getLastDigit ( num ) {
30- return num . toString ( ) . slice ( - 1 ) ;
30+ return num . toString ( ) . slice ( - 1 ) ;
3131}
3232
3333console . log ( `The last digit of 42 is ${ getLastDigit ( 42 ) } ` ) ;
3434console . log ( `The last digit of 105 is ${ getLastDigit ( 105 ) } ` ) ;
3535console . log ( `The last digit of 806 is ${ getLastDigit ( 806 ) } ` ) ;
3636
37-
3837// This program should tell the user the last digit each number.
3938// Explain why getLastDigit is not working properly - correct the problem
4039// To solve this problems we need to write variable in function.
You can’t perform that action at this time.
0 commit comments