Tell us what’s happening:
I’m not quite sure what’s happening here. My maskEmail function works perfectly well here; all of my inputs give the asked for output, with no errors whatsoever. I also tried allowing email to equal input, then logging it (ex: let email = “hi@example.com”, then console.log(email)), but to no avail. All steps after 4 are counted as incorrect.
Your code so far
function maskEmail(email){
let cutEmail = email.slice(1, email.indexOf("@") - 1)
email = email.replace(cutEmail, "*".repeat(cutEmail.length))
return console.log(email);
}
let email = "apple.pie@example.com";
maskEmail("apple.pie@example.com")
maskEmail("freecodecamp@example.com")
maskEmail("info@test.dev")
maskEmail("useer@domain.org")
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 OPR/133.0.0.0
Challenge Information:
Build an Email Masker - Build an Email Masker