Skip to content

Instantly share code, notes, and snippets.

@tomhodgins
Created January 24, 2019 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomhodgins/41db6ed93509dc9b69bdc004e3250c6f to your computer and use it in GitHub Desktop.
Save tomhodgins/41db6ed93509dc9b69bdc004e3250c6f to your computer and use it in GitHub Desktop.
function pigLatin(string='') {
return string
.split(' ')
.map(string => string.replace(/\b([^aeiouAEIOU]*)(\w+)\b/, '$2$1ay'))
.join(' ')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment