Skip to content

Instantly share code, notes, and snippets.

@sebastianherman
Last active January 9, 2021 13:11
Show Gist options
  • Save sebastianherman/e131397ec9fc29a09bd814f49f811f11 to your computer and use it in GitHub Desktop.
Save sebastianherman/e131397ec9fc29a09bd814f49f811f11 to your computer and use it in GitHub Desktop.
Functional Programming: Apply Functional Programming to Convert Strings to URL Slugs - freeCodeCamp solution
function urlSlug(title) {
return title.split(/\W/).filter(item => item).map(item => item.toLowerCase()).join("-")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment