I just joined this highly recommended website.
(我刚刚加入了这个强烈推荐的网站。)
Hope someone can help me understand code a bit better.(希望有人可以帮助我更好地理解代码。)
I am now doing the codewars challenge to make Credit Card Mask .(我现在正在做代码战挑战来制作信用卡面膜。)
So i need to mask all the numbers with # and leave the last 4 visable.(所以我需要用#掩盖所有数字,并保留最后4个可见的数字。)
Here is my code :(这是我的代码:)
function maskify(cc) {
let mask= '' ;
let all = mask.slice()
all = all.slice(-4)
for (i = 0 ; i < mask.length ; i++){
i += '#'
}
return mask[i] + all ;
}
maskify(2,3,2,1,3,2,1,321321)
can someone explain to me what I am doing wrong.
(有人可以向我解释我在做什么错。)
My JS knowlage is still basic.(我的JS知识仍然很基础。)
ask by marian nestorov translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…