Created
May 5, 2021 12:03
-
-
Save dan-laskowski/27c59386ee2d540adcb0dd19bd05c5c7 to your computer and use it in GitHub Desktop.
[Capitalize the first letter of a string] #javascript #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
// Capitalize the first letter of a string | |
const capitalize = str => `${str.charAt(0).toUpperCase()}${str.slice(1)}`; | |
capitalize("hello, you are a cool person!"); | |
// Result: "Hello, you are a cool person!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment