Widely Available
Strings
id: string-wellformed
String isWellFormed() and toWellFormed()
The
isWellFormed() method of strings returns a boolean indicating if the string contains any Unicode lone surrogates. The toWellFormed() method returns a new string where all lone surrogates are replaced by the Unicode replacement character.
Baseline Status:
Achieved Widely Available on Apr 24, 2026 (Cross-browser Newly Available since Oct 24, 2023).
Desktop Browser Engine Support
Google Chrome
111
Supported
Mozilla Firefox
119
Supported
Apple Safari
16.4
Supported
Microsoft Edge
111
Supported
Mobile Browser Engine Support
Chrome Android
111
Firefox Android
119
Safari iOS
16.4
Specifications and References