Last active
September 3, 2019 23:04
-
-
Save masautt/963203e3217f1e57d08ec36911a9b2ac to your computer and use it in GitHub Desktop.
How to capitalize first letter of string in JavaScript?
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
let str = "mylowercasestring"; | |
let cappedStr = str.charAt(0).toUpperCase() + name.slice(1)); | |
console.log(cappedStr); //--> "Mylowercasestring" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment