function that counts the number of vowels ina string and returns them as a string code example
Example 1: how to make a vowel counter in javascript
function countVowels(str) {
return str.match(/[aeiou]/g).length;
}
Example 2: count vowels in a string javascript
// BEST and FASTER implementation using regex
const countVowels = (str) => (str.match(/[aeiou]/gi) || []).length