📜  js 大写 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:03.800000             🧑  作者: Mango

代码示例6
const capitalize = s => s && s[0].toUpperCase() + s.slice(1)

// to always return type string event when s may be falsy other than empty-string
const capitalize = s => (s && s[0].toUpperCase() + s.slice(1)) || ""