You are viewing a single comment's thread. Return to all comments →
function vowelsAndConsonants(s) { let vowelsArray = ['a','e','i','o','u']; let vowels = [] let consonants = [] for(let char of s) { vowelsArray.includes(char) ? vowels.push(char) : consonants.push(char) } let vowels_and_consonant = [...vowels, ...consonants] vowels_and_consonant.forEach(elem => console.log(elem)) }
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 →