Smurfette
Smurfette

Reputation: 2005

Where can I reference all Unicode letters that JavaScript allows?

Chapter 2 of Definitive JavaScript states that an identifier must begin with

$, _, or a letter and be followed by the same + digits.

It also states that letters and digits included Unicode letters and digits.

Where can I get a list to reference all of these.

Interestingly, you can do things like:

var é

I was just looking for an exact list or description that is not overly technical.

This is for ES-5

Upvotes: 0

Views: 86

Answers (1)

Ethan Brown
Ethan Brown

Reputation: 27282

The ES5 spec explicitly lists which Unicode character categories are allowed in identifiers. Excluding Unicode escape sequences, here's a simplification of allowed identifiers:

So identifiers can start with:

After that, zero or more the following characters are also allowed (in addition to all the characters listed above):

Upvotes: 0

Related Questions