Count the vowels
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Count the vowels
Count the vowels (a e i o u) in a String, treating upper- and lower-case the same. Lower-case it first with s.toLowerCase(), then loop with s.charAt(i) and compare against each vowel.
Complete countVowels(String s) so it returns how many letters are vowels (a, e, i, o, u), ignoring case.
Click Run to see the output here.