Skip to content

Instantly share code, notes, and snippets.

@taimursaeed
Created February 9, 2018 10:03
Show Gist options
  • Save taimursaeed/e79b90c9c2159f277e25507bba3ff7e0 to your computer and use it in GitHub Desktop.
Save taimursaeed/e79b90c9c2159f277e25507bba3ff7e0 to your computer and use it in GitHub Desktop.
Capitalize First Letter JS
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
// use it like capitalizeFirstLetter('hello')
// returns Hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment