An alternative route is to use regexstring.replace() and Regular Expressions to strip everything exceptbut the vowels from the string. Then count the length of the remainingresulting string. This avoids iteration altogether.
const vowelCount = s => s.replace(/[^aeiou]/gi, '').length
console.log(vowelCount('The quick brown fox jumps over the lazy dog'))
The regex is /[^aeiou]/gi which means match everything that's NOT (^) in the set (aeiou), matching globally (g flag) and without regard to case (i flag). string.replace() then uses this pattern to replace all matching characters with a blank string. What remains are your vowels.