Tapage/app/usernameGenerate.ts

26 lines
433 B
TypeScript
Raw Normal View History

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]
}