Tell us what’s happening:
I know I should do something with the repeat() methode. but I dont know how tot use it cause you can only put a number in repeat(0) to make it work (that’s how I understood it). But how much it needs to repeat depends on the email. So an someone give me a tip on how to continue, I have the feeling im almost there so i want make it right!
Your code so far
function maskEmail(emailing) {
let emailIndex = emailing.indexOf("@");
let sliceBefore = emailing.slice(1, emailIndex -1);
let replaceEmail = emailing.replace(sliceBefore, "*")
return replaceEmail
}
let emailing = maskEmail
console.log(maskEmail("apple.pie@example.com"))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0
Challenge Information:
Build an Email Masker - Build an Email Masker