NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
要使字符串的第一个字母大写,可以使用多种方法,例如 toUpperCase 和 slice 方法,或者使用字符数组。 ``` // To capitalize the first letter, use toUpperCase and slice methods let city = 'paris'; city = city[0].toUpperCase() + city.slice(1); console.log(city); // "Paris" ```