function vowelCount(stringing) {
var string = stringing.toUpperCase();
var sum = 0;
for(var i = 0; i < string.length; i++) {
if(string[i] === "A" || string[i] === "E" || string[i] === "I" ||
string[i] === "O" || string[i] === "U" || string[i] === "Y") {
sum++
};
};
return sum;
};
const countVowels = str => Array.from(str)
.filter(letter => 'aeiou'.includes(letter)).length;
console.log(countVowels('abcdefghijklmnopqrstuvwxyz')); // 5
console.log(countVowels('test')); // 1
console.log(countVowels('ddd')); // 0
function countVowels(subject) {
return subject.match(/[aeiou]/gi).length;
}
const count = str => (str.match(/[aeiou]/gi) || []).length;
function vowelCount(stringing) {
var string = stringing.toUpperCase();
var sum = 0;
var vowel = 'aeiouAEIOU';
for(var i = 0; i < string.length; i++) {
if (vowel.indexOf(string[i]) !== -1) {sum += 1;}
};
return sum;
};
alert(vowelCount('Wolverine'))
function vowelCount(stringing) {
var string = stringing.toUpperCase();
return string.match(/[aeiou]/gi).length;
};
alert(vowelCount('Wolverine'))