Child pages
  • JSON

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rev: 1377850930704
Wiki Markup
{div:style=display: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 '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}
JSON.parse('[1, 5, "false"]');
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=parse-String_Function}{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, reviver){span}{td}{tr}{tr:id=prsdes}{td}*Parameters*\\{div:class=sIndent}\{[String]} text -- The string to parseParses a string as JSON. and Seereturns the JSON object for a 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}
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=prsdes}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The Convert a value to convert toJSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a JSON string.
replacer array is specified{div}{td}{tr}{tr:id=retprs}{td}*ReturnsParameters*\\{div:class=sIndent}\{[String]Object]} value -- The value to convert to a JSON string.
{div}{td}{tr}{tr:id=samret}{td}*SampleReturns*\\{div:class=sIndent}{code:[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
JSON.stringify([1, "false", false])
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_Function}{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, replacer){span}{td}{tr}{tr:id=prsdes}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The Convert a value to convertJSON, tooptionally areplacing JSONvalues string.
\{[Function]}if a replacer --function Ifis a functionspecified, transformsor valuesoptionally andincluding propertiesonly encounteredthe whilespecified stringifying;properties if ana replacer array is (ofspecified.
StringAs ora Number)function, specifies the setreplacer oftakes propertiestwo includedparameters, inthe objectskey inand the finalvalue being string.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{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=samprs}{td}*SampleParameters*\\{div:class=sIndent}{code:language=javascript}
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}\{[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:classid=lastDetailRowsam}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_Function_Number}{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, replacer, space){span}{*Sample*\\{div:class=sIndent}{code:language=javascript}
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:id=prsclass=lastDetailRow}{td}{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).
{tr}{tbody}{tbody:id=stringify-Object_Function_Number}{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, 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=retprs}{td}*ReturnsParameters*\\{div:class=sIndent}\{[StringObject]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_Function_String}{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, replacer, space){span}{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}} 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}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_Function_String}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=retsig}{td}*Returns*\\{divspan:class=sIndentstyle=margin-right: 5px;}[String]{div{span}{span:style=font-weight: bold;}stringify{span}{span}\(value, replacer, space){span}{td}{tr}{tr:id=samdes}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_NumberArray}{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, replacer){span}{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.
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=retprs}{td}*ReturnsParameters*\\{div:class=sIndent}\{[StringObject]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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=stringify-Object_NumberArray_Number}{tr:id=name}{td}h6.stringify} 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=sigsam}{td}*Sample*\\{spandiv:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}stringify{span}{span}\(value, replacer, space){span}{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}*Returnsclass=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_NumberArray}{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, 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}\{[StringObject]{div}{td}{} 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=samret}{td}*SampleReturns*\\{div:class=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{}[String]{div}{td}{tr}{tr:classid=lastDetailRowsam}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_NumberArray_String}{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, replacer, space){span}{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*Sample*\\{div:class=sIndent}{code:language=javascript}
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=stringify-Object_NumberArray_Number}{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, replacer, space){span}{td}{tr}{tr:id=retdes}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}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:classid=lastDetailRowprs}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_StringArray}{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, replacer){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value --*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string.
\{[StringNumber]\[]} 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}
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}{[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:classid=lastDetailRowret}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_StringArray_Number}{tr:id=name*Returns*\\{div:class=sIndent}[String]{div}{td}h6.stringify{td}{tr}{tr:id=sigsam}{td}*Sample*\\{spandiv:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}stringify{span}{span}\(value, replacer, space){spanclass=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:id=prsclass=lastDetailRow}{td}{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).
}{tr}{tbody}{tbody:id=stringify-Object_NumberArray_String}{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, 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=retprs}{td}*ReturnsParameters*\\{div:class=sIndent}\{[StringObject]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_StringArray_String}{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, replacer, space){span} 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}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_StringArray}{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, 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}
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=stringify-Object_StringArray_Number}{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, 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}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_StringArray_String}{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, 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}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}