Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Vowel count with if
var withIf = function (s) {
var vowels = 0;
for (var i=0; i < s.length-1; i++){
var letter = s[i].toLowerCase();
if (letter === "a" || letter === "e" || letter === "i" || letter === "o" || letter === "u" ){
vowels++;
}
}
return vowels;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment