In creating a function for a client, I ran into an issue where I wanted to capitalize the first letter in a string with JavaScript, or in other words, uppercase the first letter in a string with JavaScript. The solution is quite simple, all you need to do is use the following function:
function capitalize(word){
return word && word[0].toUpperCase() + word.slice(1);
}
Then, when you want to capitalize the first letter in a particular string, run the following:
var word = 'wplauncher plugins';
// this will return Wplauncher plugins
var capitalized_word = capitalize(word);