Am i missing the obvious answer? i tried every example email and every one works.
Your code so far
function maskEmail(email) {
console.log(email.replace(email.slice(1,email.indexOf("@")-1),"*".repeat(email.indexOf("@")-2)));
}
let email="freecodecamp@example.com";
maskEmail("freecodecamp@example.com");
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
You need to return the result from the function instead of logging it inside the function. Then call console.log() when you invoke the function with the email argument.