Tell us what’s happening:
The results that are desired are there, but I m not passing instruction 4.
Instruction 4
Assign as valid email address to email variable.
I tried assigning different emails but it not passing.What am I foing wrong?
Your code so far
function maskEmail(email){
const maskLength = email.slice(1 , email.indexOf("@")-1);
const exchangeChar = "*";
const eCharLength = maskLength.replace(maskLength, exchangeChar.repeat(maskLength.length)) ;
const replaceChara = email.replace(maskLength , eCharLength );
return replaceChara };
maskEmail("test@lab.com")
const email = "test@lab.com ";
console.log(maskEmail(email))
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36
Challenge Information:
Build an Email Masker - Build an Email Masker