I don’t understand how to do the rest of the steps after step 4. This should really have another workshop for stuff like this before a lab like this. It’s hard to know what to do if we don’t see it properly before hand.
Your code so far
function maskEmail(email) {let arobasePosition = email.indexOf("@");
let wordToSlice =email.slice(1, arobasePosition);
let wordToSliceCharCount = wordToSlice.lenght - 1;
let replacedChar= email.replace(wordToSlice, "*".repeat(wordToSliceCharCount));};
let email= "apple.pie@email.com";
console.log(maskEmail(email));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0
I think this lab is way too hard. I’m gonna try tomorrow. but still don’t get how to get the results I want that’s the problem. if there was more specific help in the lab it would help. I know we did see everything but I have no idea how to suggest freecodecamp had another workshop for smth like this.
You are so close! And I really like your approach…going directly after the bit that needs to be changed.
If you make one small adjustment to the line of code that creates wordToSlice and make another small correction in your code to get wordToSliceCharCount (after fixing the typo), you’ve got it!
You can check that wordToSliceCharCount is what you want by counting the asterisks in what Test #5 says your code should return.
Just make sure your function returns the final masked email.