function LetterCapitalize(str) {
return str.charAt(0).toUpperCase()+ str.slice(1);
var spaceIndex=str.indexOf(' ');
var first=str.substring(0,spaceIndex);
var second=str.substring(spaceIndex+1,str.length)
return LetterCapitalize(first)+" " + LetterCapitalize(second)
}
console.log(LetterCapitalize("hello world"))
不知道我做错了什么,但只有 H in hello 是大写的