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.
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.
This was so helpful. Thank you! I feel like they didn’t do a great job at working with string manipulation before introducing this project. I relied mostly on template liberals and the repeat function for this, in case anyone needs any additional hints
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.