The identifier (variable name) can be split up into the following parts, with explanation about each part:
- Identifier Start
- Identifier Part
This section describes what is allowed in the start of the identifier. i.e what characters are allowed as the first character of the variable name. From the EcmaScript documentation, it is described that start of the identifier can contain one of the following characters:
- Unicode Letter
- $
- _
- Unicode Escape Sequence
Unicode Letters have further categories which can be found here. The ones allowed in JS identifier start part are Lu
, Ll
, Lt
, Lm
, Lo
. It is also allowed to have Number Letters Nl
type unicode characters at the start of the identifier. Lets see each of these sub-categories briefly:
These are uppercase letters. This category includes letters from different languages such as Latin letters, Greek letters, Cyrillic letters among others. These are all capital letters. The full list can be seen here