Skip to content

Instantly share code, notes, and snippets.

@gabrielfroes
gabrielfroes / emailmask.js
Created February 21, 2018 14:57
Javascript Email Mask
/*
Create a Mask in an email address
This function create a mask using a valid email address.
This is usefull when someone need to confirm the email used in a system
Author: Gabriel Froes - https://gist.github.com/gabrielfroes
*/
function emailMask(email) {
var maskedEmail = email.replace(/([^@\.])/g, "*").split('');
var previous = "";
for(i=0;i<maskedEmail.length;i++){