Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Understand regional indicator flag sequences.
Flag Emoji is easiest to learn by reading the example, changing it, and observing the result.
// Flag emoji are two "regional indicator" letters
const flag = '🇯🇵'; // 🇯 (U+1F1EF) + 🇵 (U+1F1F5) = Japan
console.log([...flag].length); // 2 code points
console.log([...flag].map(c => c.codePointAt(0).toString(16)));
// Build a flag from a country code
const toFlag = cc => [...cc.toUpperCase()]
.map(c => String.fromCodePoint(0x1F1E6 + c.charCodeAt(0) - 65)).join('');
console.log(toFlag('us')); // 🇺🇸Practice the Flag Emoji example in a small scratch file, then explain what changed and why.