Last updated 4 years ago
Was this helpful?
if input length is less than 4 return input
return input.length-4 times '#' with last 4 digits
const maskify = (cc) => cc.length > 4 ? '#'.repeat(cc.length - 4) + cc.slice(cc.length - 4) : cc;