Concepts

JSON replacer

Try the free JavaScript compiler

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

NameTypeDescription
replacerFunction | ArrayTransform or property list.

Return Value

String | undefined

Serialized representation.

Working Example

Example Snippetjavascript
console.log(JSON.stringify({a:1,b:2},["b"]));
JavaScript Reference