Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

count vowels in a string javascript

// BEST and FASTER implementation using regex
const countVowels = (str) => (str.match(/[aeiou]/gi) || []).length
 
PREVIOUS NEXT
Tagged: #count #vowels #string #javascript
ADD COMMENT
Topic
Name
4+4 =