Skip to content

Commit d2547c9

Browse files
committed
Add explanation for getLastDigit function parameter issue
1 parent d51b30d commit d2547c9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • Sprint-3/2-mandatory-debug

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`);
2222

2323
// Explain why the output is the way it is
2424
// =============> write your explanation here
25+
// The bug is in line 9, where 'getLastDigit()' is declared with no parameters
26+
// Instead the function body reaches out to 'const num = 103' and disregards the values passed because the function does not declare any parameter
27+
2528
// Finally, correct the code to fix the problem
2629
// =============> write your new code here
2730

0 commit comments

Comments
 (0)