Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Last active August 28, 2017 13:31
Show Gist options
  • Save ericelliott/b1a3b8f8fdf04bb750c03cb355027376 to your computer and use it in GitHub Desktop.
Save ericelliott/b1a3b8f8fdf04bb750c03cb355027376 to your computer and use it in GitHub Desktop.
Nesting function composition
const toSlug = input => encodeURIComponent(
join('-')(
map(toLowerCase)(
split(' ')(
input
)
)
)
);
console.log(toSlug('JS Cheerleader')); // 'js-cheerleader'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment