String.prototype.isWellFormedintermediate'hello'.isWellFormed() // β true
'π'.isWellFormed() // β true
'οΏ½'.isWellFormed() // β falseUse isWellFormed() to check if a string contains no lone surrogate code units (ES2024).
str.isWellFormed() returns true if the string contains no lone surrogate code units (i.e., it is a valid Unicode string).
This is an ES2024 method.
Challenge: Implement checkWellFormed(str) that returns str.isWellFormed().
checkWellFormed('hello') // β true