Build an Email Masker

// mask porition

const maskPortion = (email) => {

const atIndex = email.indexOf(“@”);

return email.slice(1, atIndex-1);

}

const maskEmail = (email) => {

return email.replace(maskPortion(email), “*”.repeat(maskPortion(email).length));

}

let email = “apple.pie@example.com”;

console.log(maskEmail(email));

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.