Created
October 21, 2019 17:40
-
-
Save trv469/c91bf663e0250939f8ef43852c68a23b to your computer and use it in GitHub Desktop.
Capitalize en JS
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 capitalizeLetter(string) { | |
| let cadena = string.toLowerCase(); | |
| let spliteElememt = cadena.split(" "); | |
| let capitalize = ""; | |
| for (const item of spliteElememt) { | |
| capitalize += `${item.charAt(0).toUpperCase() + item.slice(1)} `; | |
| } | |
| return capitalize; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment