Why do not you return the first letter in uppercase?
function LetterCapitalize(str) {
var strArray = str.split(' '),maxA = strArray.length,j=0;
for(;j<maxA;j++){
strArray[j][0] = strArray[j][0].toUpperCase();
}
return strArray.join(' ');
}
console.log(LetterCapitalize('eduardo sebastian'));
In my code I try to send a string as a parameter and return the first letter of the words in uppercase, but it does not work, why?