Codeloft
0 0 XP

Count the vowels

Easy 30 XP

Write countVowels(text) that returns how many of a, e, i, o, u appear, in any case.

Tests

0 of 4 pass
  1. countVowels("banana") → 3
  2. countVowels("SKY") → 0
  3. countVowels("Education") → 5
  4. countVowels("") → 0
countVowels.jsPress Run or Ctrl + Enter
Nothing printed. Use console.log to inspect values.