it keeps logging out undefined and i am not sure of what to do
Your code so far
function maskEmail(email) {
let first = email.slice(0, 1);
let last = email.slice(domain - 1, domain);
let mid = email.indexof("@");
let domain = email.slice(mid);
let stars = "*".repeat(domain - 2);
return first + stars + last + domain;
}
let email = "joe36@gmail.com";
console.log(email.maskEmail);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:156.0) Gecko/20100101 Firefox/156.0
The email variable is a sample data meant to test the function and the second line in there is supposed to log the end product of the email being passed through the function.
Thank you very much. I have been able to complete it. I think the main roadblock was that I used variables without paying attention to their datatypes.