Created
June 29, 2023 16:01
-
-
Save aneudy1702/48d0d72143d7277b8e12e4a749d7f3c8 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
function maskNumbers(fullNumber, lastCharactersLen){ | |
const last4Digits = fullNumber.slice(-lastCharactersLen); | |
const maskedNumber = last4Digits.padStart(fullNumber.length, '*'); | |
return last4Digits.padStart(fullNumber.length, '*'); | |
// Expected output: "************5581" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment