1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| const t="abcdefghijklmnopqrstuvwxyz1";
let adresse="";
function mail(){
for(let i=0;i<5;i++){
adresse+=t[Math.floor(Math.random()*t.length)];
}
adresse+=".";
for(let i=0;i<5;i++){
adresse+=t[Math.floor(Math.random()*t.length)];
}
adresse+="@";
for(let i=0;i<4;i++){
adresse+=t[Math.floor(Math.random()*t.length)];
}
adresse+=".fr";
return adresse;
}
while(!adresse.match(/\d/)){
if(adresse.length){
console.log("mauvaise adresse: ", adresse)
};
adresse="";
mail()
}
console.log("bonne adresse: ", adresse) |
Partager