_comuns/dist-import/aleatorio.js
2024-05-07 10:17:51 -03:00

2 lines
219 B
JavaScript

const alfabeto = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
export const aleatorio = (tamanho) => Array.from({ length: tamanho || 8 }, () => `ale-${alfabeto[Math.floor(Math.random() * 1000) % alfabeto.length]}`).join("");