← Back to challenges

Cluster Vowels, Single Out Consonants

JavaScriptHardstringsregex

Instructions

Write a function that takes in a word and splits the consonants one by one, but keeps the vowels in a cluster.

Examples

split("beautifully") ➞ ["b", "eau", "t", "i", "f", "u", "l", "l", "y"]

split("spoonful") ➞ ["s", "p", "oo", "n", "f", "u", "l"]

split("swimming") ➞ ["s", "w", "i", "m", "m", "i", "n", "g"]

Notes

  • Vowels are: a, e, i, o, u.
  • All letters will be in lower case.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Find the Odd Integer