Created
February 9, 2018 10:03
-
-
Save taimursaeed/e79b90c9c2159f277e25507bba3ff7e0 to your computer and use it in GitHub Desktop.
Capitalize First Letter JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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