You could do like this:
function createRandomVowels(length) {
const vowels = ['a', 'e', 'i', 'o', 'u', 'y' ];
return Array.from({ length }, () => vowels[Math.floor(Math.random() * vowels.length)]);
}
console.log(createRandomVowels(2));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…