I tried to make an alert popup with “A” with:
var a = \u0041;
alert(a);
However, I get an error in Chrome Console: Uncaught ReferenceError: A is not defined.
What does that mean? I don’t have a variable called A anywhere.
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.
\u0041 is the unicode for capital letter A. The interpreter translates it as is, not assuming that it is a string.
To alert the value rather than looking for a variable with that name, do
alert("\u0041")Following your code style, the modified code would look like this: