Concepts
JSON replacer
Function transforms values top-down after applicable toJSON calls; an array specifies property names to include in object serialization.
Formal Syntax & Structure
javascript syntaxjavascript
JSON.stringify(value, replacer)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| replacer | Function | Array | Transform or property list. |
Return Value
String | undefined
Serialized representation.
Working Example
Example Snippetjavascript
console.log(JSON.stringify({a:1,b:2},["b"]));