Skip to content

Commit 286c2a2

Browse files
committed
update
1 parent b124f10 commit 286c2a2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828

2929
// This program should tell the user the last digit of each number.
3030
// Explain why getLastDigit is not working properly - correct the problem
31-
//-The function was looking at the outside "num" but Now there are two (num) one outside the scope "const num= 103" and i added another inside the function scope.
31+
//-I removed the unnecessary const num = 103 because the function already receives num as a parameter.
3232
//-The function calculates something and returns it then console.log outside receives that returned value and prints it.
3333

34-
const num = 103;
34+
3535

3636
function getLastDigit(num) {
3737
return num.toString().slice(-1);

0 commit comments

Comments
 (0)