File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Sprint-2/2-mandatory-debug Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11// Predict and explain first...
22
33// Predict the output of the following code:
4- // =============>
4+ // =============>
55// The last digit of 42 is 3
66// The last digit of 105 is 3
77// The last digit of 806 is 3
@@ -24,7 +24,8 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`);
2424// =============> the variable num is assigned to the value 103 in the global scope and not assigned to any value in the function scope
2525// Finally, correct the code to fix the problem
2626// =============> write your new code here
27- function getLastDigit ( num ) { // we add the identifier num as parameter to the function getLastDigit
27+ function getLastDigit ( num ) {
28+ // we add the identifier num as parameter to the function getLastDigit
2829 return num . toString ( ) . slice ( - 1 ) ;
2930}
3031
You can’t perform that action at this time.
0 commit comments