Returns the value, coerced to a string.
This typically calls the object’s toString method, but with some special cases:
- If the
valueis anArrayBuffer(e.g., returned from a web request) orTypedArray, then this call decodes the value as UTF-8 text. - If the object’s underlying
toStringmethod is the degenerate implementation ofObject.toString()(which normally returns the text “[object Object]”), this method returnsnullinstead. The principle is that it’s better for this method to essentially fail than for it to return a useless string.