JS Built-ins
StringString.prototype.normalizeintermediate

String.prototype.normalize() β€” compare normalized strings

πŸ“– 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() β€” Comparison

Two strings that look identical but use different Unicode representations will NOT be === equal unless both are normalized to the same form.

Challenge: Implement normalizedEqual(a, b) that returns true when both strings are NFC-equal.

normalizedEqual('\u00e9', '\u0065\u0301') // β†’ true (same visual, different encoding)
πŸ’‘ Hints (1)
  • β€’ Without normalization, `"\u00e9" !== "\u0065\u0301"` even though they look the same.