• + 0 comments

    This is mine

    const isVowel = (caracter) => ['a','e','i','o','u'].includes(caracter); const printVowel = (caracter) => isVowel(caracter) && console.log(caracter); const printConsonant = (caracter) => !isVowel(caracter) && console.log(caracter); const textLength = (text) => text.length;

    const mapText = (text, vowel) => { var i = 0; while(i < textLength(text)){ vowel ? printVowel(text[i]): printConsonant(text[i]);
    i++; } }

    function vowelsAndConsonants(s) {
    mapText(s, true); mapText(s, false); }