Last active
February 21, 2019 19:07
-
-
Save leongaban/25d144ef63a72447880345ff43ba50f8 to your computer and use it in GitHub Desktop.
capitalizeFirstLetter
This file contains hidden or 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); | |
} | |
// ES6 & Typescript version: | |
export const capitalizeFirstLetter = (word: string) => | |
word.charAt(0).toUpperCase() + word.slice(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment