重庆熊猫 Loading

JavaScript 字符串的首字母大写

const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1)
let result = capitalize("panda")  // Panda

console.log(result);
posted @ 2022-09-09 10:25  重庆熊猫  阅读(30)  评论(0)    收藏  举报