๐ง under construction
Last updated 2 years ago
Was this helpful?
JS โฉ value โฉ primitive โฉ String โฉ Unicode โฉ encoding โฉ UTF-16 โฉ code unit
UTF-16 code units are 16-bit unsigned integers. (0x0000 ~ 0xFFFF)
string.codePointAt(index)
string.slice(start, end)
string[index]
uses index of code units, not charactersโ
. will split by UTF-16 code units and will separate โ
By default, regular expressions work on , not actual charactersโ
(dangerous) use code units
string.length
string
(safe) use code points
string iteration (for-of loop)
replit โฉ code unit
// code
Unicode
Eloquent JavaScript โฉ Strings & Character Codes
UTF-16 characters, code points, grapheme clusters
String.prototype โฉ
.charCodeAt()
โฉ
split("")