Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What unusual characters in addition to $ are allowed in JavaScript identifiers?

I want a variable like $ that is sort of special, but I'm already using jQuery, so $ is taken.

like image 259
Josh Gibson Avatar asked Jul 18 '09 01:07

Josh Gibson


1 Answers

Unfortunately, older javascript supports letters, numbers, underscores, and $ in identifiers. In javascript 1.5 and later you can use Unicode characters, but that would be a very bad idea as they can be a pain to enter into most editors, and certainly aren't something you would want to have to type very often.

Source

like image 174
Brian Ramsay Avatar answered Sep 20 '22 18:09

Brian Ramsay