Tell us what’s happening:
Hi everyone. I reviewed the answers of those who solved this problem, but i still can’t understand where i made a mistake in my code. Help me find the reason why one test is filing
Your code so far
function maskEmail(email) {
const replacementElement = "*";
let newLength = email.length - 14;
let newEmail = email.slice(-13);
return email[0]+replacementElement.repeat(newLength)+newEmail;
};
let email = "apple.pie@example.com";
maskEmail(email)
console.log(maskEmail(email));
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Challenge Information:
Build an Email Masker - Build an Email Masker