Child pages
  • JSON

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hiddendiv: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 EXTRACTAUTO CHANGESUPDATE FROM THE PAGECONTENT ANDTHROUGH MERGETHE THEM BACK INTO SERVOY SOURCE{hiddenDOC GENERATOR{div}
{sub-sectiondiv:id=description|text=}{sub-sectiondiv}\\ 

{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|class=node}{tr:id=name}{td}h6.parse{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}parse{span}{span:id=iets|style=float: left;}\(text){span}{td}{tr}{builder-show:permission=edit}{tr:tr:id=desprs}{td}{sub-section:parse-String_des|trigger=button|text=}{sub-section}{sub-section:parse-String_des|trigger=none|class=sIndent}Replace with description{sub-section*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}{builder-show}{builder-show:permission=edit}{tr:tr:id=sncret}{td}*SinceReturns*\\{sub-section:parse-String_snc|trigger=button|text=}{sub-section}{sub-section:parse-String_snc|trigger=none|div:class=sIndent} Replace with version info{sub-section[Object]{div}{td}{tr}{builder-show}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:parse-String_prs|trigger=button|text=}{sub-section}{sub-section:parse-String_prs|trigger=none|class=sIndent}\{[String]} text -- The string to parse as JSON.  See the JSON object for a description of JSON syntax.
{sub-sectiondiv:class=sIndent}{code:language=javascript}
JSON.parse('[1, 5, "false"]');
{code}{div}{td}{tr}{tr:id=retclass=lastDetailRow}{td}{td}*Returns*\\{sub-section:parse-String_ret|trigger=button|text=}{sub-section}{sub-section:parse-String_ret|trigger=none|class=sIndent}[Object]{sub-section}{tr}{tbody}{tbody:id=parse-String_Function}{tr:id=name}{td}h6.parse{td}{tr}{builder-show:permission=edit}{tr:id=seesig}{td}*Also see*\\{sub-section:parse-String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:parse-String_see|trigger=none}{sub-section}{div{span:style=margin-right: 5px;}[Object]{span}{span:style=font-weight: bold;}parse{span}{span}\(text, reviver){span}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:parse-String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:parse-String_link|trigger=none}{sub-section}\{[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}{builder-show}{tr:id=samret}{td}*SampleReturns*\\{sub-section:parse-String_sam|trigger=button|text=}{sub-section}div:class=sIndent}[Object]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{sub-section:parse-String_sam|trigger=none}{code:language=javascript}
var transformed = JSON.parse('[1{"p": 5}', 5function(k, "false"]');
{code}{sub-sectionv) { if (k === "") return v; return v * 2; });
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=parse-String_Function|class=nodestringify-Object}{tr:id=name}{td}h6.parsestringify{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[ObjectString]{span}{span:id=iets|style=float: left; font-weight: bold;}parsestringify{span}{span:id=iets|style=float: left;}\(text, revivervalue){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:parse-String_Function_des|trigger=button|text=}{sub-section}{sub-section:parse-String_Function_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string.
{div}{td}{tr}{builder-show}{builder-show:permission=edittr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:parse-String_Function_snc|trigger=button|text=}{sub-section}{sub-section:parse-String_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-sectiondiv:class=sIndent}{code:language=javascript}
JSON.stringify([1, "false", false])
{code}{div}{td}{tr}{builder-show}{tr:id=prsclass=lastDetailRow}{td}{td}*Parameters*\\{sub-section:parse-String_Function_prs|trigger=button|text=}{sub-section}{sub-section:parse-String_Function_prs|trigger=none|class=sIndent}\{[String]} text -- The string to parse as JSON.  See the JSON object for a description of JSON syntax{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=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string.
\{[Function]} reviverreplacer -- If Aa function, prescribestransforms values howand theproperties valueencountered originallywhile producedstringifying; byif parsingan isarray transformed,(of beforeString being returned.
{sub-sectionor Number), specifies the set of properties included in objects in the final string.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:parse-String_Function_ret|trigger=button|text=}{sub-section}{sub-section:parse-String_Function_ret|trigger=none|div:class=sIndent}[ObjectString]{sub-sectiondiv}{td}{tr}{builder-show:permission=edit}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:parse-String_Function_see|trigger=button|text=}{sub-section}{div:class=div:class=sIndent}{sub-section:parse-String_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:parse-String_Function_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:parse-String_Function_link|trigger=none}{sub-sectioncode: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}{builder-show}{tr:id=samclass=lastDetailRow}{td}{td}*Sample*\\{sub-section:parse-String_Function_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:parse-String_Function_sam|trigger=none}{code:language=javascript}
var transformed = JSON.parse('{"p": 5}', function(k, v) { if (k === "") return v; return v * 2; });
{code}{sub-section}{div}{{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:classid=lastDetailRowprs}{td}{td}{tr}{tbody}{tbody:id=stringify-Object|class=node}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:stringify-Object_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:stringify-Object_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section*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}{builder-show}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:stringify-Object_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_prs|trigger=none|class=sIndent}\{[Object]} value -- The value to convert to a JSON string.
{sub-sectiondiv:class=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:id=retclass=lastDetailRow}{td}{td}*Returns*\\{sub-section:}{tr}{tbody}{tbody:id=stringify-Object_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_ret|trigger=none|class=sIndentFunction_String}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{sub-sectionspan}{span:style=font-weight: bold;}stringify{span}{span}\(value, replacer, space){span}{td}{tr}{builder-show:permission=edit}{tr:id=seeprs}{td}*Also seeParameters*\\{sub-section:stringify-Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:stringify-Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:stringify-Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_sam|trigger=none}{code:language=javascript}
JSON.stringify([1, "false", false])
{code}{sub-section}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:classid=lastDetailRowret}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_Function|class=node}{tr:id=name}{td}h6.stringify*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sigsam}{td}*Sample*\\{spandiv:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer){spanclass=sIndent}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{builder-showtr:permissionclass=editlastDetailRow}{tr:id=des}td}{td}{sub-section:stringify-Object_Function_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_des|trigger=none|class=sIndent}Replace with description{sub-section}tr}{tbody}{tbody:id=stringify-Object_NumberArray}{tr:id=name}{td}h6.stringify{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sncsig}{td}*Since*\\{sub-section:stringify-Object_Function_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_snc|trigger=none|class=sIndent} Replace with version info{sub-section{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}stringify{span}{span}\(value, replacer){span}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_Function_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_prs|trigger=none|class=sIndent}\{[Object]} value div:class=sIndent}\{[Object]} value -- The value to convert to a JSON string.
\{[FunctionNumber]\[]} 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.
{sub-sectiondiv}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_Function_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_ret|trigger=none|div:class=sIndent}[String]{sub-sectiondiv}{td}{tr}{builder-show:permission=edit}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:stringify-Object_Function_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:stringify-Object_Function_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:stringify-Object_Function_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_Function_Number|class=node}{tr:id=name}{td}h6.stringifycode: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=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}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{tr:id=sigclass=lastDetailRow}{td}{td}{tr}{tbody}{span:style=float: left; 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:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer, space){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:stringify-Object_Function_Number_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:stringify-Object_Function_Number_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_Function_Number_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_Number_prs|trigger=none|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 *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.
\{[NumberString]} 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).
{sub-sectiondiv}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_Function_Number_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_Number_ret|trigger=none|class=sIndent}div:class=sIndent}[String]{sub-sectiondiv}{td}{tr}{builder-show:permission=edit}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:stringify-Object_Function_Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_Number_see|trigger=none}{sub-sectioncode:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{builder-show}{builder-show:permission=edittr:class=lastDetailRow}{td}{td}{tr:id=link}{td}*External links*\\{sub-section:tbody}{tbody:id=stringify-Object_Function_Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_Number_link|trigger=none}{sub-section}{divStringArray}{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}{builder-show}{tr:id=samprs}{td}*SampleParameters*\\{sub-section:stringify-Object_Function_Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_Number_sam|trigger=none}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{sub-section}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:classid=lastDetailRowret}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_Function_String|class=node}{tr:id=name}{td}h6.stringify*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sigsam}{td}*Sample*\\{spandiv:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer, space){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:stringify-Object_Function_String_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_String_des|trigger=none|class=sIndent}Replace with description{sub-sectionclass=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}{builder-showtbody}{builder-showtbody:permission=editid=stringify-Object_StringArray_Number}{tr:id=sncname}{td}*Since*\\{sub-section:stringify-Object_Function_String_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_Function_String_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_String_prs|trigger=none|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.
\{[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.
\{[StringNumber]} 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).
{sub-sectiondiv}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_Function_String_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_Function_String_ret|trigger=none|class=sIndent}[String]{sub-sectiondiv:class=sIndent}[String]{div}{td}{tr}{builder-show:permission=edit}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:stringify-Object_Function_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_String_see|trigger=none}{sub-sectioncode:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{div}{td}{tr}{builder-show}{builder-show:permission=edittr:class=lastDetailRow}{td}{td}{tr:id=link}{td}*External links*\\{sub-section:tbody}{tbody:id=stringify-Object_FunctionStringArray_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_String_link|trigger=none}{sub-section}{divtr: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}{builder-show}{tr:id=samprs}{td}*SampleParameters*\\{sub-section:stringify-Object_Function_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_Function_String_sam|trigger=none}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_NumberArray|class=node}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:stringify-Object_NumberArray_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:stringify-Object_NumberArray_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_NumberArray_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_prs|trigger=none|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.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_NumberArray_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:stringify-Object_NumberArray_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:stringify-Object_NumberArray_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:stringify-Object_NumberArray_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_NumberArray_Number|class=node}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer, space){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:stringify-Object_NumberArray_Number_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:stringify-Object_NumberArray_Number_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_NumberArray_Number_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_Number_prs|trigger=none|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).
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_NumberArray_Number_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_Number_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:stringify-Object_NumberArray_Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:stringify-Object_NumberArray_Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:stringify-Object_NumberArray_Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_Number_sam|trigger=none}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_NumberArray_String|class=node}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer, space){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:stringify-Object_NumberArray_String_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:stringify-Object_NumberArray_String_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_NumberArray_String_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_String_prs|trigger=none|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).
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_NumberArray_String_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_NumberArray_String_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:stringify-Object_NumberArray_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:stringify-Object_NumberArray_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:stringify-Object_NumberArray_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_NumberArray_String_sam|trigger=none}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_StringArray|class=node}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:stringify-Object_StringArray_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:stringify-Object_StringArray_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_StringArray_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_prs|trigger=none|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.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_StringArray_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:stringify-Object_StringArray_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:stringify-Object_StringArray_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:stringify-Object_StringArray_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_sam|trigger=none}{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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_StringArray_Number|class=node}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer, space){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:stringify-Object_StringArray_Number_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_Number_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:stringify-Object_StringArray_Number_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_StringArray_Number_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_Number_prs|trigger=none|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).
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_StringArray_Number_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_Number_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:stringify-Object_StringArray_Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:stringify-Object_StringArray_Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:stringify-Object_StringArray_Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_Number_sam|trigger=none}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=stringify-Object_StringArray_String|class=node}{tr:id=name}{td}h6.stringify{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringify{span}{span:id=iets|style=float: left;}\(value, replacer, space){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:stringify-Object_StringArray_String_des|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:stringify-Object_StringArray_String_snc|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:stringify-Object_StringArray_String_prs|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_String_prs|trigger=none|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).
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:stringify-Object_StringArray_String_ret|trigger=button|text=}{sub-section}{sub-section:stringify-Object_StringArray_String_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:stringify-Object_StringArray_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:stringify-Object_StringArray_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-showdiv: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*\\{sub-section:stringify-Object_StringArray_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:stringify-Object_StringArray_String_sam|trigger=none}{code:language=javascript}
JSON.stringify({ uno: 1, dos : 2 }, null, '\t')
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}