Child pages
  • JSON

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay:none

DO

NOT

EDIT

THE

CONTENT

OF

THIS

PAGE

DIRECTLY

(EXCEPT

INSIDE

THE

DIV

BELOW

WITH

ID=DESCRIPTION),

UNLESS

YOU

KNOW

WHAT

YOU'RE

DOING.


THE

STRUCTURE

OF

THE

CONTENT

IS

VITAL

IN

BEING

ABLE

TO

AUTO

UPDATE

THE

CONTENT

THROUGH

THE

DOC

GENERATOR.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Object]{td}{td}[#parse]\(text) Parses a string as JSON and returns the parsed value.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#parse]\(text, reviver) Parses a string as JSON and returns the parsed value.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer, space) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer, space) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer, space) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer, space) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer, space) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringify]\(value, replacer, space) Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=parse-String}{tr:id=name}{td}h6.parse{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Object]{span}{span:style=font-weight: bold;}parse{span}{span}\(text){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Parses a string as JSON and returns the parsed value.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} text -- The string to parse as JSON. See the JSON object for a description of JSON syntax. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Object]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

Div
iddescription


HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#parse(text)
Parses a string as JSON and returns the parsed value.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#parse(text, reviver)
Parses a string as JSON and returns the parsed value.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer, space)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer, space)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer, space)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer, space)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer, space)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#stringify(value, replacer, space)
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idparse-String
Table Row (tr)
idname
Table Cell (td)
parse
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
parse
Span
(text)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Parses a string as JSON and returns the parsed value.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} text – The string to parse as JSON. See the JSON object for a description of JSON syntax.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

JSON.parse('[1, 5, "false"]');
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idparse-String_Function
}{
Table Row (tr)
:
id
=
name
}{td}h6.parse{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
parse
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
Object
]{span}{span:style=
Span
stylefont-weight:
bold;
}
parse
{span}{span}\(text, reviver){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Parses a string as JSON and returns the parsed value.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} text -- The string to parse as JSON. See the JSON object for a description of JSON syntax. \{[Function]} reviver -- A function, prescribes how the value originally produced by parsing is transformed, before being returned. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Object]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Span
(text, reviver)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Parses a string as JSON and returns the parsed value.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} text – The string to parse as JSON. See the JSON object for a description of JSON syntax.
{Function} reviver – A function, prescribes how the value originally produced by parsing is transformed, before being returned.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var transformed = JSON.parse('{"p": 5}', function(k, v) { if (k === "") return v; return v * 2; });
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}stringify{span}{span}\(value){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object
Table Row (tr)
idname
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
stringify
Span
(value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

JSON.stringify([1, "false", false])
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_Function
}{
Table Row (tr)
:
id
=
name
}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[Function]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
replacer)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{Function} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

function censor(key, value) {  
 if (typeof(value) == "string") {  
   return undefined;  
 }   
 return value;  
}  
      
var foo = {foundation: "Mozilla", model: "box", week: 45, transport: "car", month: 7};  
var jsonString = JSON.stringify(foo, censor);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_Function_Number
}{
Table Row (tr)
:
id
=
name
}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer,
space)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[Function]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. \{[Number]} space -- The space argument may be used to control spacing in the final string (causes the resulting string to be pretty\-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it). {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{Function} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
{Number} space – The space argument may be used to control spacing in the final string (causes the resulting string to be pretty-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_Function_String
}{
Table Row (tr)
:
id
=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
name
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer,
space)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[Function]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. \{[String]} space -- The space argument may be used to control spacing in the final string (causes the resulting string to be pretty\-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it). {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{Function} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
{String} space – The space argument may be used to control spacing in the final string (causes the resulting string to be pretty-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_NumberArray
}{
Table Row (tr)
:
id
=
name
}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[Number]\[]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{Number[]} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

function censor(key, value) {  
 if (typeof(value) == "string") {  
   return undefined;  
 }   
 return value;  
}  
      
var foo = {foundation: "Mozilla", model: "box", week: 45, transport: "car", month: 7};  
var jsonString = JSON.stringify(foo, censor);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_NumberArray_Number
}{
Table Row (tr)
:
id
=
name
}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer,
space)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[Number]\[]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. \{[Number]} space -- The space argument may be used to control spacing in the final string (causes the resulting string to be pretty\-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it). {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{Number[]} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
{Number} space – The space argument may be used to control spacing in the final string (causes the resulting string to be pretty-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_NumberArray_String
}{
Table Row (tr)
:
id
=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
name
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer,
space)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[Number]\[]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. \{[String]} space -- The space argument may be used to control spacing in the final string (causes the resulting string to be pretty\-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it). {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{Number[]} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
{String} space – The space argument may be used to control spacing in the final string (causes the resulting string to be pretty-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_StringArray
}{
Table Row (tr)
:
id
=
name
}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[String]\[]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{String[]} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

function censor(key, value) {  
 if (typeof(value) == "string") {  
   return undefined;  
 }   
 return value;  
}  
      
var foo = {foundation: "Mozilla", model: "box", week: 45, transport: "car", month: 7};  
var jsonString = JSON.stringify(foo, censor);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_StringArray_Number
}{
Table Row (tr)
:
id
=
name
}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[String]{span}{span:style=
String
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer,
space)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[String]\[]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. \{[Number]} space -- The space argument may be used to control spacing in the final string (causes the resulting string to be pretty\-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it). {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{String[]} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
{Number} space – The space argument may be used to control spacing in the final string (causes the resulting string to be pretty-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idstringify-Object_StringArray_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
stringify
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
String
]{span}{span:style=
Span
stylefont-weight:
bold;
}
stringify
{span}{span}\
Span
(value,
replacer,
space)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified. As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified, and it then gets called for each property on the object or array being stringified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string. \{[String]\[]} replacer -- If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string. \{[String]} space -- The space argument may be used to control spacing in the final string (causes the resulting string to be pretty\-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it). {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
As a function, the replacer takes two parameters, the key and the value being stringified. Initially it gets called with an empty key representing the object being stringified,
and it then gets called for each property on the object or array being stringified.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} value – The value to convert to a JSON string.
{String[]} replacer – If a function, transforms values and properties encountered while stringifying; if an array (of String or Number), specifies the set of properties included in objects in the final string.
{String} space – The space argument may be used to control spacing in the final string (causes the resulting string to be pretty-printed). If it is a number, successive levels in the stringification will each be indented by this many space characters (up to 10). If it is a string, successive levels will indented by this string (or the first ten characters of it).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)