You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 712ef52
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: Sprint-3/2-mandatory-debug/2.js
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,5 +42,8 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`);
42
42
43
43
// This program should tell the user the last digit of each number.
44
44
// Explain why getLastDigit is not working properly - correct the problem
45
+
46
+
// Answer below:
47
+
45
48
// The global constant variable outside the function has affected the code and caused it to always reference the last number of the global variable
46
49
// To fix this, the global variable will be removed from code and the function getLastDigit should take the variable name "num" assigned to the global variable.
0 commit comments