Topic
#unicode
1 piece
The substring that cuts a character in half
Slice a string that holds an emoji or a rare kanji and you can split one character into two, because JavaScript indexes by UTF-16 code unit, not by character. `[...str]` and `Array.from` fix surrogate pairs but still tear ZWJ emoji and combining marks apart; the only walk that respects every visible character is `Intl.Segmenter` at grapheme granularity.