Created
July 2, 2020 09:34
-
-
Save Rigel772/5bfa7972283a060f7b29b839e8ef3290 to your computer and use it in GitHub Desktop.
[capitalize string] #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
| const capitalize = (name) => { | |
| name = name.toLowerCase(); | |
| return `${name.charAt(0).toUpperCase()}${name.slice(1)}` | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment