Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想得到一个字母的javascript数字表示来做一些相对操作,即在伪代码中进行类似'a'.getNumberRep - 'b'.getNumberRep的操作。
在 js 中执行此操作的最佳方法是什么?
'a'.charCodeAt(0) - 'b'.charCodeAt(0)