JavaScript 字符串的首字母大写
const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1)
let result = capitalize("panda") // Panda
console.log(result);
本文来自博客园,作者:重庆熊猫,转载请注明原文链接:https://www.cnblogs.com/cqpanda/p/16671909.html
const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1)
let result = capitalize("panda") // Panda
console.log(result);
本文来自博客园,作者:重庆熊猫,转载请注明原文链接:https://www.cnblogs.com/cqpanda/p/16671909.html