Last active
May 15, 2019 18:52
-
-
Save williammustaffa/3e48c5f794ab3ac5c50209940f4f1332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getLastDigits = (cardNumber = '') => { | |
const match = cardNumber.match(/(?<lastDigits>\d{4})$/); | |
return match && match.groups.lastDigits || false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment