var str = 'abcd';
//获取对应的ascii
var codeValue = str.charCodeAt(0);
console.log(codeValue);//97
//将对应的编码值转为字符
var charValue = String.fromCharCode(codeValue);
console.log(charValue);//a