JSON.stringify()
Description
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
This method returns a string for the formatted text. When only the binary data is needed, use JSON.encode() instead, which can be more efficient without the need of an extra string conversion.
Syntax
JSON.stringify(value)
Parameters
stringify(value, replacer?, space?)
A JavaScript value, usually an object or array, to be converted.
A function that transforms the results.
Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
stringify(value, replacer?, space?)
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
A JavaScript value, usually an object or array, to be converted.
An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
stringify(value, replacer?, space?)
Serializes a value in JSON format.
A value of any type to serialize in JSON format.
A callback function that receives a value being serializing via its three parameters (key, value and container) and returns a replacement value to be serialized instead.
Number of spaces for the indentation, or zero for no indentation. Default is 0.
A string after serialization.