Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Vowel Count with IndexOf
var withIndex = function (s) {
var vowels = 0;
var vowelArray = ["a","e","i","o","u"];
for (var i = 0; i < s.length-1; i++){
if (vowelArray.indexOf(s[i].toLowerCase()) !== -1 ) {
return vowels;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.