Unicode point escapes
This page describes JavaScript's lexical grammar. JavaScript source text is just a sequence of characters — in order for the interpreter to understand it, the string has to be parsed to a more structured representation. The initial step of parsing is called lexical analysis, in which the text gets scanned from left to right and is converted into a sequence of individual, atomic input elements. Some input elements are insignificant to the interpreter, and will be stripped after this step — they include white space and comments. The others, including identifiers, keywords, literals, and punctuators (mostly operators), will be used for further syntax analysis. Line terminators and multiline comments are also syntactically insignificant, but they guide the process for automatic semicolons insertion to make certain invalid token sequences become valid.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 44 | 12 | 40 | 9 | 44 | 9 | |
Syntax
'\u{1F600}'; // '😀'
'\u{41}'; // 'A'
// Traditional surrogate pair
'\uD83D\uDE00'; // '😀' (same character) Live demo
Characterdisplay with co-point.
\u{...} shape notation. escape-pshi-kens Use, special character display..
4 digit co-point
is representationationation in or, 4 digit character(saroge-tpea that main character) directlydescribe.. with traditional. \uXXXX
Use cases
-
Using Unicode point escapes
This page describes JavaScript's lexical grammar.
Cautions
- No specific concerns. Stable across all major browsers.
Accessibility
- When updating the DOM dynamically, announce important changes to assistive technology with aria-live regions.