logo CodeStepByStep logo

vowelCount

Language/Type: JavaScript functions return string
Author: Melissa Hovik (on 2016/09/25)

Write a function named vowelCount that accepts a string and returns the number of vowels (a, e, i, o, or u) that the string contains.

For example, the call of vowelCount("kookaburra") should return 5 (two o's, 2 a's, and one u). When passed a string without any vowels (such as an empty string, "01234", or "sky"), 0 should be returned.

Function: Write a JavaScript function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.