I noticed that in Internet Explorer (but, unfortunately, not in the other browsers I tested), you can use some Unicode variable names. This made my day, and I was absolutely delighted that I could write fun Unicode-laden code like this:
var ктоε?ναι草泥马 = "You dirty horse.",
happy?n?mat?p?eia = ":)Yay!",
?_? = "emoticon";
alert(ктоε?ναι草泥马 + happy?n?mat?p?eia + ?_?);
For some reason, though, ◎?◎
, ?_?
and ?
are not valid variable names.
Why do ?_?
and 草泥马
work, but ◎?◎
, ?_?
and ?
don't?
EDIT: Test it out in your browser on JSFiddle. I've tested it in Internet Explorer 9, Chrome, Firefox, and Opera. So far, it seems to only work in Internet Explorer 9. (I don't know about Internet Explorer 8 and below.) Let me know if it works in another browser.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…