Created
September 4, 2021 05:46
-
-
Save madeleine68/cebe67106435103be278e7e1f5690868 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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