You are viewing a single comment's thread. Return to all comments →
To add to the multiple solutions posted, this was my method:
function vowelsAndConsonants(s) {
const vowelArray = ["a", "e", "i", "o", "u"]; let outputVowel = ""; let outputConsonant = ""; for (let i = 0, len = s.length; i < len; i++) { if (vowelArray.includes(s[i])) { outputVowel += s[i] + '\n'; } else { outputConsonant += s[i] + '\n'; } } console.log(outputVowel + outputConsonant)
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Loops
You are viewing a single comment's thread. Return to all comments →
To add to the multiple solutions posted, this was my method:
function vowelsAndConsonants(s) {
}