Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Understand the � shown for invalid bytes.
The Replacement Character is easiest to learn by reading the example, changing it, and observing the result.
// Invalid UTF-8 bytes decode to the replacement character U+FFFD ( � )
const invalid = new Uint8Array([0xff, 0xfe, 0x41]);
console.log(new TextDecoder('utf-8').decode(invalid)); // "��A"
// Seeing � in output means bytes did not match the declared encoding.Practice the The Replacement Character example in a small scratch file, then explain what changed and why.