Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

first letter of string in uppercase using javascript

function capFirst(str) {
     return str[0].toUpperCase() + str.slice(1);
 }

console.log(capFirst('hello'));
//output 
//Hello
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #letter #string #uppercase #javascript
ADD COMMENT
Topic
Name
6+6 =