javascript - Character representation from hexadecimal -
is possible convert hexadecimal value respective ascii character, not using string.fromcharcode
method, in javascript?
for example:
javascript:
0x61 // 97 string.fromcharcode(0x61) //
c-like:
(char)0x61 //
not in fashion, because javascript loosely typed, , not allow 1 define variable's data type.
what can do, though, creating shortcut:
var char = string.fromcharcode; // copy function variable
then can call char
instead of string.fromcharcode
:
char(0x61); //
which quite close want (and perhaps more readable/requiring less typing).
Comments
Post a Comment