JS: Allowed Characters in Identifier
Allowed characters in JavaScript identifiers
JavaScript identifiers (variable/function names) must:
- Begin with a Unicode Letter, or low line _, dollar sign $.
- Following characters must be Unicode Letter or Unicode digit or low line or dollar sign.
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 😄.)