EXERCISE · AlgoCasts

Vowels

Write a function that returns the number of vowels used in a string. Vowels are the characters 'a', 'e' 'i', 'o', and 'u'.

5 testsAlgoCastsGPL-3.01 alternateexercise 11 of 26

Directions

Directions

Write a function that returns the number of vowels used in a string. Vowels are the characters 'a', 'e' 'i', 'o', and 'u'.

Examples#

JS
vowels('Hi There!') --> 3vowels('Why do you ask?') --> 4vowels('Why?') --> 0

Try it first#

Copy the stub, make the 5 tests pass on your machine, then open the solution. The reveal is remembered per page in this browser.

JSexercises/vowels/index.js
function vowels(str) {} module.exports = vowels;

See also