JSON
Module | ejs |
Namespace | intrinsic |
Definition | final class JSON |
Inheritance | JSON Object |
Properties
Qualifiers | Property | Type | Description |
No properties defined |
JSON Methods
Inherited Methods
Method Detail
Parse a string JSON representation and return an object equivalent.
- Parameters
data: String | JSON string data to parse |
filter: Function | The optional filter parameter is a function that can filter and transform the results. It receives each of the keys and values, and its return value is used instead of the original value. If it returns what it received, then the structure is not modified. If it returns undefined then the member is deleted. NOTE: the filter function is not yet implemented. |
- Returns
- An object representing the JSON string.
Convert an object into a string JSON representation.
- Parameters
obj: Object | Object to stringify |
replacer: Object | an optional parameter that determines how object values are stringified for objects without a toJSON method. It can be a function or an array. |
indent: Number | an optional parameter that specifies the indentation of nested structures. If it is omitted, the text will be packed without extra whitespace. If it is a number, it will specify the number of spaces to indent at each level. If it is a string (such as '\t' or ' '), it contains the characters used to indent at each level. |
- Returns
- A JSON string representing the object.