Unicode in JavaScript
summary
JavaScript strings use UTF-16 so many emoji and math letters live outside the BMP, creating surrogate pairs that make "length" return two for one visible symbol. Unicode spans 1,114,112 code points across 17 planes; the BMP holds 65,536. Workarounds shown include manual surrogate math and ES6 features like String.fromCodePoint and code point escapes \u{...}, plus a small online validator that actually checks whether a name is a valid JS identifier.
AI-written summary · about
chapters (7)
- 0:00What is Unicode
- 2:00Code points
- 5:00Hexadecimal escape sequences
- 7:00Surrogates
- 9:00Length properties
- 13:00Solutions
- 17:00String Code Points








