Skip to content

Instantly share code, notes, and snippets.

@BrockReece
Created October 26, 2016 11:33
Show Gist options
  • Save BrockReece/8eefe56ddd7cc098d2a612e654dbb9a2 to your computer and use it in GitHub Desktop.
Save BrockReece/8eefe56ddd7cc098d2a612e654dbb9a2 to your computer and use it in GitHub Desktop.
Split slug into separate words and capitalise
field.field_slug.split('_').join(' ').replace(/\b\w/g, l => l.toUpperCase())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment