Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Understand emoji built from joined parts.
ZWJ Emoji Sequences is easiest to learn by reading the example, changing it, and observing the result.
// Many emoji are several emoji joined by U+200D (Zero Width Joiner)
const family = '👨👩👧👦'; // man + ZWJ + woman + ZWJ + girl + ZWJ + boy
console.log(family.length); // 11 UTF-16 units
console.log([...family].length); // 7 code points
// Count what users SEE with a grapheme segmenter:
const seg = new Intl.Segmenter('en', { granularity: 'grapheme' });
console.log([...seg.segment(family)].length); // 1Practice the ZWJ Emoji Sequences example in a small scratch file, then explain what changed and why.