const cardNumber = '123328409283048023'
const lastFourCard = cardNumber.slice(-4)
const finalCard = lastFourCard.padStart(cardNumber.length,'*')
console.log(finalCard);
const cardNumber = '123328409283048023'
const lastFourCard = cardNumber.slice(-4)
const finalCard = lastFourCard.padStart(cardNumber.length,'*')
console.log(finalCard);
本文标题:es8 padStart 身份证号码替换*
本文链接:https://www.haomeiwen.com/subject/dtiigrtx.html
网友评论