• + 0 comments

    To add to the multiple solutions posted, this was my method:

    function vowelsAndConsonants(s) {

    const vowelArray = ["a", "e", "i", "o", "u"];
    let outputVowel = ""; 
    let outputConsonant = ""; 
    
    for (let i = 0, len = s.length; i < len; i++) {
    
        if (vowelArray.includes(s[i])) {
            outputVowel += s[i] + '\n';
        } else {
            outputConsonant += s[i] + '\n';
    
        }
    
    }
    
    console.log(outputVowel + outputConsonant)
    

    }