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