Skip to content

Instantly share code, notes, and snippets.

@brianfiszman
Last active July 12, 2018 21:08
Show Gist options
  • Save brianfiszman/c77d2c06a4afd5f82615645ca4eeccd8 to your computer and use it in GitHub Desktop.
Save brianfiszman/c77d2c06a4afd5f82615645ca4eeccd8 to your computer and use it in GitHub Desktop.
Log vowels and then consonants of a string
/*
* Complete the vowelsAndConsonants function.
* Print your output using 'console.log()'.
*/
const vowelsAndConsonants = s =>
console.log(
s.match(/[aeiou]/gi).join("\n") +
"\n" +
s.match(/[^aeiou0-9_\W]/gi).join("\n")
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment