Skip to content

Instantly share code, notes, and snippets.

@richtier
Created January 18, 2014 00:22
Show Gist options
  • Save richtier/8484200 to your computer and use it in GitHub Desktop.
Save richtier/8484200 to your computer and use it in GitHub Desktop.
append url with slash if not present
function appendSlash(url){
return url + /\/$/.test(url) ? '' : '/';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment