Tag: fromcharcode

在JavaScript中与Python的chr()相对应

JavaScript方法String.fromCharCode()行为等同于Python的unichar() ,其含义如下: print unichr(213) # prints Õ on the console console.log(String.fromCharCode(213)); // prints Õ on the console as well 但是,为了我的目的,我需要一个与Python函数chr()相当的JavaScript。 有没有这样的JavaScript函数或方式使String.fromCharCode()行为像chr() ? 也就是说,我需要一些模仿JavaScript的东西 print chr(213) # prints on the console