JS Built-ins
StringString.prototype.normalizeadvanced

String.prototype.normalize() β€” NFKC

πŸ“– Usage Example
const e1 = 'Γ©'           // Γ© precomposed
const e2 = 'é'    // e + combining accent
e2.normalize('NFC') === e1    // β†’ true

Use normalize() to convert a string to a Unicode normal form, useful for comparing visually identical strings.

String.prototype.normalize() β€” NFKC

NFKC (Compatibility Decomposition + Canonical Composition): also maps compatibility characters to their canonical equivalents.

For example, the full-width digit '\uFF10' (0) normalizes to '0' under NFKC.

Challenge: Implement toNFKC(str) using .normalize('NFKC').

πŸ’‘ Hints (1)
  • β€’ NFKC converts compatibility variants (full-width, superscripts, etc.) to their ASCII equivalents.