• + 0 comments

    Newby, doing things very slowly, but thouroughly. Method goes throught the string twice, Once for vowels, and second time for consonants.

    function vowelsAndConsonants(s) { for (let x = 0; x < s.length; x++){ if(s[x]=='a' || s[x]=='e' || s[x]=='i' || s[x]=='o' || s[x]=='u'){ console.log(s[x]) } } for (let x = 0; x < s.length; x++){ if (s[x]!='a' && s[x]!='e' && s[x]!='i' && s[x]!='o' && s[x]!='u'){ console.log(s[x]) } } }