Method to obtain the corresponding ASCII encoding charCodeAt()
var str = "b";
console.log(str.charCodeAt());;
Copy the code
Get the corresponding String fromCharCode() from ASCII
var code = 98;
console.log(String.fromCharCode(code));
Copy the code