toJSON

fun toJSON(key: ERROR CLASS: Symbol not found for JsAny?? = definedExternally): String(source)

Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

MDN Reference