JavaScript: Allowed Characters in Identifier

By Xah Lee. Date: . Last updated: .

What is allowed characters in JavaScript identifiers?

JavaScript identifiers (variable/function names) must:

Here is a example you can test:

/* α GREEK SMALL LETTER ALPHA codepoint 945, hexadecimal 3b1 */
const α = 4;
console.log(α === 4);
const ♥ = 3;

SyntaxError: Invalid or unexpected token

♥ BLACK HEART SUIT codepoint 9829, hexadecimal 2665 is not a letter

(To search for Unicode, or find a character's codepoint, see: Unicode Search 😄.)

What characters are Unicode Letter?

What Characters Are Unicode Letter

Allowed Characters and Case Sensitivity

BUY ΣJS JavaScript in Depth