JS: Allowed Characters in Identifier
Allowed characters in JavaScript identifiers
JavaScript identifiers (variable/function names) must:
- Begin with a Unicode Letter Character, or low line _, or dollar sign $.
- Following characters must be Unicode Letter or Unicode digit or low line or dollar sign.
Math symbols such as ⊕ ° are not allowed.
// U+3B1: GREEK SMALL LETTER ALPHA const α = 4; // U+3C6: GREEK SMALL LETTER PHI const φ = (x) => x + 1; console.log(φ(α)); // 4
const ° = Math.PI / 180; // U+B0: DEGREE SIGN console.log(90 * °); // 1.5707963267948966 // error: The module's source code could not be parsed: Unexpected character '°' // const ° = Math.PI / 180; // ~