Answers for "Create a function that counts the number of vowels within a string. It should handle both capitalized and uncapitalized vowels."

1

how to make a vowel counter in javascript

const vowelCount = str => {
  let vowels = /[aeiou]/gi;
  let result = str.match(vowels);
  let count = result.length;

  console.log(count);
};
Posted by: Guest on April-08-2020
0

count vowels in a string javascript

// BEST and FASTER implementation using regex
const countVowels = (str) => (str.match(/[aeiou]/gi) || []).length
Posted by: Guest on August-17-2020

Code answers related to "Create a function that counts the number of vowels within a string. It should handle both capitalized and uncapitalized vowels."

Code answers related to "Javascript"

Browse Popular Code Answers by Language