Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Created September 6, 2016 00:50
Show Gist options
  • Save ericelliott/41149cf676c23b959caa53960a3d70f3 to your computer and use it in GitHub Desktop.
Save ericelliott/41149cf676c23b959caa53960a3d70f3 to your computer and use it in GitHub Desktop.
Using pipe()
const toSlug = pipe(
split(' '),
map(toLowerCase),
join('-'),
encodeURIComponent
);
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