Skip to content

Instantly share code, notes, and snippets.

@madeleine68
Created September 4, 2021 05:46
Show Gist options
  • Save madeleine68/cebe67106435103be278e7e1f5690868 to your computer and use it in GitHub Desktop.
Save madeleine68/cebe67106435103be278e7e1f5690868 to your computer and use it in GitHub Desktop.
let numberOfVowels = function(data) {
let count = 0;
for (var i = 0; i < data.length; i++) {
if(data[i] === 'a' || data[i] === 'e' || data[i] === 'i' || data[i] === 'o' || data[i] === 'u') {
count++;
}
}
return count;
};
console.log(numberOfVowels("orange"));
console.log(numberOfVowels("lighthouse labs"));
console.log(numberOfVowels("aeiou"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment