toJSON

external fun toJSON(): String(source)

The toJSON() method of the TrustedHTML interface returns a JSON representation of the stored data.

MDN Reference