🚧 under construction
JS ⟩ value ⟩ primitive ⟩ String ⟩ Unicode ⟩ encoding ⟩ UTF-16
(16-bit Unicode Transformation Format)
UTF-16 uses 16-bit unsigned integers as its code units.
a code point is transformed into one or two UTF-16 code units.
(plane 0) code points with only 1 code unit is called a "scalar".
(plane 1 ~ 16) code points with 2 code units is called a "surrogate pair".
replit ⟩
// code
Eloquent JavaScript ⟩ Strings & Character Codesarrow-up-right
UTF-16 characters, code points, grapheme clustersarrow-up-right
String.prototype ⟩
.charCodeAt()arrow-up-right
.codePointAt()arrow-up-right
Stringarrow-up-right ⟩
.fromCodePoint()arrow-up-right
.fromCharCode()arrow-up-right
Last updated 3 years ago