String.prototype.isWellFormedbeginner'hello'.isWellFormed() // β true
'π'.isWellFormed() // β true
'οΏ½'.isWellFormed() // β falseUse isWellFormed() to check if a string contains no lone surrogate code units (ES2024).
An empty string has no code units, so it cannot contain lone surrogates. It is well-formed.
Challenge: Implement emptyIsWellFormed() that returns ''.isWellFormed().