函数大写每个单词(str){return str.replace(/\w\S*/g,函数(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase(;});}警觉的文档.write(大写EachWord('o BAR God bAD'));
函数大写每个单词(str){return str.replace(/\w\S*/g,函数(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase(;});}警觉的(大写每个单词(“oo BAR God bAD”);
函数大写每个单词(str){return str.replace(/\w\S*/g,函数(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase(;});}文档.写入(大写每个单词(“oo BAR God bAD”);