JS: Allowed Characters in Identifier

By Xah Lee. Date: . Last updated: .

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 😄.)

Allowed Characters and Case Sensitivity