Tell us what’s happening:
I am stuck how do I go about masking the email and appending the domain.
Your code so far
function maskEmail(email){
email.slice()
}
const email = 'apple.pie@example.com';
console.log(maskEmail(email));
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Challenge Information:
Build an Email Masker - Build an Email Masker
Hi there and welcome to our community!
Have you completed the course materials which come before this project? Methods like slice
(and other string manipulation methods) are covered in detail in earlier lessons.
What are you struggling with exactly?
There’s a lot you can do with your code. Lemme give you a hint.
1 - find a word that can separate the domain name or username which is “@” using “IndexOf”
2 - then with the use of “slice” extract both.
3 - create a variable and mask the username with the asterisk sign(*), use the concatenation method.
make sure to first word or last domain is visible.
4 - return the masked variable.
Your outer function is correct.
Happy Coding.