Tell us what’s happening:
I’m really stuck please help. I don’t understand what’s required of me?
Your code so far
function maskEmail(email){
const [username, domain] = email.split("@");
if (username.length <= 2) "*****@" + domain;
return `${username[0]}*****${username[username.length - 2]}@${domain}`;
}
let email = "apple.pie@example.com";
console.log(maskEmail("apple.pie@example.com"));
console.log(maskEmail("freecodecamp@example.com"));
console.log(maskEmail("info@test.dev"));
console.log(maskEmail("user@domain.org"));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:153.0) Gecko/20100101 Firefox/153.0
Challenge Information:
Build an Email Masker - Build an Email Masker