7.6 Identifiers

2010-03-09

Identifiers can contain any UnicodeLetter, UnicodeCombiningMark, UnicodeDigit and UnicodeConnectorPunctuation. On top of that, they may also contain UnicodeEscapeSequence, $ and _. An IdentifierName may not match a reserved word.

Furthermore, of all the Unicode classes, the first character may only be a UnicodeLetter (but also a $, _ or UnicodeEscapeSequence!).

The UnicodeEscapeSequence cannot add a character to an identifier that would otherwise be illegal.

Two identifiers are only equal to eachother if they are represented by the same character sequence in the source text. This means that foo and \u0066oo will NOT refer to the same variable, even though their names evaluate to the same string (\u0066 is the character 'f').