Skip to content

Commit 428cd8a

Browse files
authored
Clarify error message for .slice() method usage
Added explanation about the error caused by using .slice() on a number.
1 parent 2d3769c commit 428cd8a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ console.log(last4Digits);
77
// Then run the code and see what error it gives.
88
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
99
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
10+
11+
// The .slice() method works on strings, but numbers don't have a .slice() method and it will cause this error : cardNumber.slice is not a function

0 commit comments

Comments
 (0)