Tapage/app/usernameGenerate.ts
2024-08-09 14:38:16 +02:00

25 lines
433 B
TypeScript

const prenom = [
"Stéphane",
"Hubert",
"Alphonse",
"Marjolaine",
"Cathy",
"Patrick",
"Agathe",
"Erneste",
]
const nom = [
"Falzar",
"Globule",
"Bermuda",
"Zigounette",
"Pissenlit",
"Détritus",
]
export function getUsername(){
const prenomIndex = Math.floor(Math.random() * prenom.length)
const nomIndex = Math.floor(Math.random() * nom.length)
return prenom[prenomIndex] + " " + nom[nomIndex]
}