We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 2: Loops
Day 2: Loops
Sort by
recency
|
776 Discussions
|
Please Login in order to post a comment
function vowelsAndConsonants(s) { var consonantsChars=[] var myArr= s.split(''); var vowelChars= myArr.filter(function(char){ if(char=='a' ||char=='e'||char=='i'||char=='o'||char=='u'){ return 1; }else{ consonantsChars.push(char) ; } } ) vowelChars.forEach(char=>{ console.log(char); }) consonantsChars.forEach(char=>{ console.log(char); }) }
function vowelsAndConsonants(s) { let vowel =[] let cons =[] let ans =[] for(var i=0; i
I must have done mine like the cave men, lol
} `