var str = ‘中‘;
var charCode = str.charCodeAt(0);
console.log(charCode); // => 20013;
str.charCodeAt(0).toString(16);//=>"4e2d"
时间: 2024-11-13 10:53:28
var str = ‘中‘;
var charCode = str.charCodeAt(0);
console.log(charCode); // => 20013;
str.charCodeAt(0).toString(16);//=>"4e2d"