js english vowel letters code example
Example 1: javascript replace vowel
function vowel2index(str) {
return str.replace(/[aeiou]/ig, (m, i) => i + 1);
}
Example 2: find the vowel js
function vowel_count(str1)
{
var vowel_list = 'aeiouAEIOU';
var vcount = 0;
for(var x = 0; x < str1.length ; x++)
{
if (vowel_list.indexOf(str1[x]) !== -1)
{
vcount += 1;
}
}
return vcount;
}
console.log(vowel_count("The quick brown fox"));