Is it possible to convert a hexadecimal value to its respective ASCII character, not using the String.fromCharCode method, in JavaScript?
For example:
JavaScript:
0x61 // 97
String.fromCharCode(0x61) // a
C-like:
(char)0x61 // a
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not in that fashion, because JavaScript is loosely typed, and does not allow one to define a variable’s data type.
What you can do, though, is creating a shortcut:
Then you can call
charinstead ofString.fromCharCode:Which is quite close to what you want (and perhaps more readable/requiring less typing).