Skip to content

Instantly share code, notes, and snippets.

@exbotanical
Created August 1, 2019 08:08
Show Gist options
  • Save exbotanical/d61530752f235821c87604cc70837b03 to your computer and use it in GitHub Desktop.
Save exbotanical/d61530752f235821c87604cc70837b03 to your computer and use it in GitHub Desktop.
//convert string to url slug without affecting global variable
function urlSlug(title) {
return title.toLowerCase().trim().split(/\s+/).join("-")
}
//TO-DO: port this function into small application that generates url slugs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment