<reponame>arisuvade/programs<filename>javascript-programs/protectEmail.js<gh_stars>0function protectEmail(email) {
  let emailAddress = email.split("@");
  let username = `${emailAddress[0].slice(0, 5)}...`;
  let domainName = `@${emailAddress[1]}`;
  return username + domainName;
}

console.log(protectEmail("upchh@example.com"));
console.log(protectEmail("anpch@example.com"));
