Skip to content

Instantly share code, notes, and snippets.

@davidsharp
Last active July 19, 2021 09:56
Show Gist options
  • Select an option

  • Save davidsharp/50d1a35948496b227155da2ffb0f4b9c to your computer and use it in GitHub Desktop.

Select an option

Save davidsharp/50d1a35948496b227155da2ffb0f4b9c to your computer and use it in GitHub Desktop.
// reverses the vowels of a (lowercase) word
(
s=>(r=/[aeiou]/g,x=s.match(r),c=x.length,s.replace(r,_=>x[--c]))
)('geographically') // -> gaigraphocelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment