JavaScript中fromCharCode和charCodeAt方法

String.fromCharCode 方法

说明:从一些 Unicode 字符值中返回一个字符串。
如: String.fromCharCode(65)     输出结果为A

charCodeAt方法
说明:charCodeAt(index : Number)返回一个整数,该整数表示 String 对象中指定位置处的字符的 Unicode 编码。一个字符串中的第一个字符位于索引位置 0,第二个字符位于索引位置 1,依此类推。如果指定 index 没有字符,将返回 NaN
如:var a = 'A';
    则a.charCodeAt(0)       输出结果为65
又如var a='ABC';
    则a.charCodeAt(1) 和a.charCodeAt(2)   分别输出66,67  
原文地址:https://www.cnblogs.com/di305449473/p/1214969.html