Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to capitalize first letter in javascript

function capitalize(word) {
    return word.charAt(0).toUpperCase() + word.toLocaleLowerCase().substring(1)
}
capitalize("bob");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #capitalize #letter #javascript
ADD COMMENT
Topic
Name
3+5 =