与数字互相转换

基本类型 / 字符类型

//TypeScript 中没有 char 类型,只有 string 
let charA = 'A'
let intValue = charA.charCodeAt(0)
//intValue is 65
console.log(`charA is \"${charA}\"`)
console.log(`intValue is ${intValue}`)

intValue++
let charB = String.fromCharCode(intValue)
//charB is 'B'
console.log(`charB is \"${charB}\"`)
console.log(`intValue is ${intValue}`)