JS Built-ins
StringString.prototype.isWellFormedbeginner

String.prototype.isWellFormed() β€” emoji string is true

πŸ“– Usage Example
'hello'.isWellFormed()      // β†’ true
'πŸ˜€'.isWellFormed()         // β†’ true
'οΏ½'.isWellFormed()     // β†’ false

Use isWellFormed() to check if a string contains no lone surrogate code units (ES2024).

String.prototype.isWellFormed() β€” Emoji

An emoji like 'πŸ˜€' is stored as a valid surrogate pair, so it IS well-formed.

Challenge: Implement emojiIsWellFormed() that returns 'πŸ˜€'.isWellFormed().

πŸ’‘ Hints (1)
  • β€’ Emoji are encoded as proper surrogate pairs, so they pass the well-formedness check.