From 59d8265b1305035a660c4496b775e9607fdb47a8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Mon, 1 Jul 2024 10:48:35 +0200 Subject: [PATCH] =?UTF-8?q?code.js=20:=20fabriquer=20courriel=20avec=20cha?= =?UTF-8?q?=C3=AEne=20(@xxx)=20donn=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code.js b/code.js index 7a2e43e..ba97e78 100644 --- a/code.js +++ b/code.js @@ -303,3 +303,14 @@ function getCourriel(tab) } } return getCourriel(${lescourriels}) + +// fabriquer un courriel qui contient une chaîne (@xxx) donnée +function homonyme(chaine, lg) { + let chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; + let str = ''; + for (let i = 0; i < lg; i++) { + str += chars.charAt(Math.floor(Math.random() * chars.length)); + } + return str + chaine + ".fr"; +} +return homonyme(${courriel_cherche}, 9);