//电子系统5 函数大写(字符串){ return string.charAt(0).toUpperCase()+string.slice(1).toLowerCase(; } 大写(“alfredo”)//=>“alfredo“ 大写(“Alejandro”)//=>“Alejandero 大写(“ALBERTO”)//=>“ALBERTO” 大写(“ArMaNdO”)//=>“ArMaNdO” //es6使用破坏 const capitalie=([first,…rest])=>first.toUpperCase()+rest.join(“”).toLowerBase();
2.8万 1 18 25