Last active
July 25, 2020 06:50
-
-
Save ansidev/72f724a4fdb63be9a0419f4c1d7edd1a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 date = new Date(2019, 0, 1); | |
const day = date.getDate().toString(); | |
console.log(day.padStart(2, '0')); |
This file contains hidden or 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 phoneNumber = '01234567890'; | |
const last4Digits = phoneNumber.slice(-4); | |
const maskedPhoneNumber = last4Digits.padStart(phoneNumber.length, '*'); | |
console.log(maskedPhoneNumber); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment