to Json
Serializes the given data object into a JSON string.
Return
A JSON string representation of the provided data object.
Parameters
data
The object to be serialized into JSON format.
pretty Print
Specifies whether the JSON string should be formatted with indentation for readability. Defaults to false for compact JSON.