Count the vowels
EasyStrings · JavaScript
The task
Write countVowels(s) that returns how many vowels (a, e, i, o, u) are in s.
Count both lower case and upper case letters. Treat y as a consonant.
Examples
- countVowels("Hello World") returns 3
Your code runs in your browser, in a separate worker, and is never sent to us. Edit the function, then press Run tests. Your work is saved here as you type.
JavaScriptCtrl or Cmd + Enter to run