Skip to content

Commit 6f5e1ca

Browse files
author
russom
committed
Change number type to string to make it work edge cases.
1 parent 0a6358a commit 6f5e1ca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • Sprint-2/2-mandatory-errors

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const cardNumber = 4533787178994213;
2-
const last4Digits = Number(String(cardNumber).slice(-4));
1+
const cardNumber = "4533787178994213";
2+
const last4Digits = cardNumber.slice(-4);
33

44
console.log(last4Digits);
55

0 commit comments

Comments
 (0)