Skip to content

Instantly share code, notes, and snippets.

@mahamshahid18
Last active March 30, 2017 05:51
Show Gist options
  • Save mahamshahid18/e20b6f8e52084eeb926748740422889b to your computer and use it in GitHub Desktop.
Save mahamshahid18/e20b6f8e52084eeb926748740422889b to your computer and use it in GitHub Desktop.

Unicode Characters Allowed in JavaScript Variable Names (as of ES6)

The identifier (variable name) can be split up into the following parts, with explanation about each part:

  • Identifier Start
  • Identifier Part

Identifier Start

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 Letter

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:

Lu (Letter, uppercase)

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

Ll (Letter, lowercase)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment