I can’t get the right amount of * to repeat, I’ve been stuck on this for a while, but my brain is apparently just not working, so any help would be appreciated!
try debugging, make sure you know what the value of each variable is, do not assume that it has the correct value. If you do that you will figure it out
it seems to be a problem with the middle characters, the length keeps coming back an extra letter than it should, but i genuinely don’t know how to fix it.
once you see the value that is wrong you are going to quickly solve it
let email = ("example@email.com");
console.log(maskEmail(email));
in this case, whats the value of indexOfAt? is it the value you expect?
what’s the value of domain? is the value you expect?
what’s the value of domName ? is the value you expect?
what’s the value of firstChar ? is the value you expect?
what’s the value of lastChar ? is the value you expect?
what’s the value of midChar ? is the value you expect?
what’s the value of lengthOfMidChar ? is the value you expect?
what’s the value of maskedDomain ? is the value you expect?