如何将任何字符转换为密钥代码,如
m 77
n 78
o 79
p 80
q 81
r 82
s 83
t 84
u 85
v 86
答案 0 :(得分:1)
var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''),
len = alphabet.length,
i;
for (i = 0; i < len; ++i) {
console.log(alphabet[i], alphabet[i].charCodeAt(0) - 32);
}