Function “toJSON”

function toJSON(value)

Converts a value to a JSON string

Parameters

NameTypeDescription
valueanyAny value to convert to a JSON string

Return Value

Returns a JSON string representing the given value.