Created
July 4, 2018 16:12
-
-
Save webinista/0bd7be3b8cb7afa710dafba803c4f432 to your computer and use it in GitHub Desktop.
Uppercase the first letter of a word with JavaScript
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 ucfirst(word) { | |
const wordarray = word.split(''); | |
wordarray[0] = wordarray[0].toUpperCase(); | |
return wordarray.join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment