Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Compare text case-insensitively across scripts.
Case Folding is easiest to learn by reading the example, changing it, and observing the result.
const names = ['Zoé', 'apple', 'Ähnlich', 'banana'];
// Locale-aware, case-insensitive sorting
const collator = new Intl.Collator('de', { sensitivity: 'base' });
console.log(names.sort(collator.compare));
// Case-insensitive compare across scripts
console.log('STRASSE'.localeCompare('straße', 'de', { sensitivity: 'accent' }));Practice the Case Folding example in a small scratch file, then explain what changed and why.