Skip to content

Instantly share code, notes, and snippets.

@nicholasxjy
Created May 9, 2017 03:32
Show Gist options
  • Save nicholasxjy/cd4c06bea982a018b14d520e82d2110a to your computer and use it in GitHub Desktop.
Save nicholasxjy/cd4c06bea982a018b14d520e82d2110a to your computer and use it in GitHub Desktop.
titlecase string in js
function titleCase(str) {
str = str.toLowerCase()
return str.charAt(0).toUpperCase() + str.slice(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment