Skip to content

Instantly share code, notes, and snippets.

@BolajiAyodeji
Last active June 5, 2019 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BolajiAyodeji/5255bb1d2c81b7c63028b978a7a04768 to your computer and use it in GitHub Desktop.
Save BolajiAyodeji/5255bb1d2c81b7c63028b978a7a04768 to your computer and use it in GitHub Desktop.
const urlSlug = (postTitle) => {
let postUrl = postTitle.toLowerCase().split(' ');
let postSlug = postUrl.join('-');
return postSlug;
}
let postTitle = 'Handling Static Forms, The Client-side Way'
console.log(urlSlug(postTitle));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment