寫法一:
let name = 'hello'
name.charAt(0).toUpperCase() + name.slice(1)
寫法二:
let name = 'hello'
name.slice(0, 1).toUpperCase() + name.slice(1)
寫法三:
let name = 'hello'
name.substring(0, 1).toUpperCase() + name.substring(1)
三種寫法的原理都是一樣的,提取首字母轉為大寫,和剩余的字符一起組成一個新的字符
