Created
July 19, 2021 09:39
-
-
Save davidsharp/62d4726fb097032f7d4f8cc913158d59 to your computer and use it in GitHub Desktop.
This file contains 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
// sorts the vowels in a (lowercase) word | |
( | |
s=>(r=/[aeiou]/g,x=s.match(r).sort(),c=0,s.replace(r,_=>x[c++])) | |
)('crocodile') // -> crecidolo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment