Count Vowels
JAVASCRIPT
Easy
+15 XP
Problem Description
Write a function `countVowels(str)` that returns the number of vowels (a, e, i, o, u) in a string (case-insensitive).
Example:
countVowels('hello') → 2
countVowels('JavaScript') → 3
countVowels('rhythm') → 0
Example:
countVowels('hello') → 2
countVowels('JavaScript') → 3
countVowels('rhythm') → 0
Test Cases
Input: countVowels('hello')
Expected: 2
Input: countVowels('JavaScript')
Expected: 3
Input: countVowels('rhythm')
Expected: 0
Input: countVowels('AEIOU')
Expected: 5
Your Solution