Created
January 7, 2020 01:02
-
-
Save AsaoluElijah/9ef57660f7fcd92da49a9d1d782b292f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the vowelsAndConsonants function. | |
* Print your output using 'console.log()'. | |
*/ | |
function vowelsAndConsonants(s) { | |
let output = []; | |
s = s.toLowerCase(); | |
let letters = s.split(""); | |
for(let i = 0; i < letters.length; i++){ | |
if(s[i] == "a" || s[i] == "e" || s[i] == "i" || s[i] == "o" || s[i] == "u"){ | |
console.log(s[i]); | |
}else{ | |
output.push(s[i]); // + '\n'; | |
} | |
} | |
for(let j = 0; j < output.length; j++){ | |
console.log(output[j]); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment