📅  最后修改于: 2022-03-11 15:02:11.605000             🧑  作者: Mango
// this will only capitalize the first word
var name = prompt("What is your name");
firstLetterUpper = name.slice(0,1).toUpperCase();
alert("Hello " + firstLetterUpper + name.slice(1, name.length).toLowerCase());