Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
454 B
1
Indexable
Never
function vowelsAndConsonants(s) {
    for (let i = 0; i < s.length; i++) {
     let vowels = s[i] == "a" || s[i] == "e" || s[i] == "i" || s[i] == "o" || s[i] == "u";
    if ( vowels ) {
        console.log(s.charAt(i))
    } 
    
    }
   for (let i = 0; i < s.length; i++) {
       let consonants = (!(s[i] == "a" || s[i] == "e" || s[i] == "i" || s[i] == "o" || s[i] == "u"))
    if ( consonants ) {
        console.log(s.charAt(i))
    } 
    
    }
}