programming-examples/js/Vre1/Count the number of vowels in a given string.js

7 lines
193 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
function vowel_count(str) {
return str.match(/[aeiou]/gi).length;
}
console.log(vowel_count('The quick brown fox jumps over the lazy dog'));