Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Capitalize the first letter of each word

const mySentence = "freeCodeCamp is an awesome resource";
const words = mySentence.split(" ");

words.map((word) => { 
    return word[0].toUpperCase() + word.substring(1); 
}).join(" ");
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Capitalize #letter #word
ADD COMMENT
Topic
Name
8+6 =