Build an Email Masker - Build an Email Masker

Tell us what’s happening:

Everything is correct but why the code did not pass the test.
Step 7: Your maskEmail should produce the correct result.? what does it really mean?

Your code so far

function maskEmail (email){
  const maskedCharacters = email.slice(1, -13);
  return email.slice(0,1) + "*".repeat(maskedCharacters.length) + email.slice(-13)
}

let email = "apple.pie@example.com";

console.log(maskEmail(email));

email = "freecodecamp@example.com"

console.log(maskEmail(email));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0

Challenge Information:

Build an Email Masker - Build an Email Masker

hello adn welcome to fcc forum :slight_smile:

  • you need to rethink this, you are “hard coding” this, perhaps try making it dynamic so that it works for every “domain” (i.e. some@notexample.com)

happy coding :slight_smile: