You are viewing a single comment's thread. Return to all comments →
function vowelsAndConsonants(s) { const vowels = ["a", "e", "i", "o", "u"]; let consonants = ""; for(let i = 0; i < s.length; i++){ if(vowels.includes(s[i])){ console.log(s[i]); }else{ consonants += s[i]; } } for(let i = 0; i < consonants.length; i++){ console.log(consonants[i]) } }
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 →