Glossary
Surrogate pair
Two code units used to represent one character above U+FFFF.
JavaScript strings and JSON escapes use 16-bit code units, which can only address characters up to U+FFFF. Characters above that (most emoji, many historic scripts, some CJK extensions) are stored as two code units called a surrogate pair.
This is why one emoji can report a length of 2, and why a JSON escape for an emoji needs two \u sequences rather than one. Neither half means anything alone; they are only valid together and in order.
The practical hazard is truncation. Cutting a string to a fixed number of characters can split a pair, leaving a lone surrogate that is not valid text, which then fails validation, renders as a replacement character, or is rejected by a database. Truncating by code point rather than code unit avoids it.