JSON.stringify
2228 ワード
The
A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of
A String or Number object that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes.If this is a
関連項目:https://ko.javascript.info/json
JSON.stringify()
method converts a JavaScript object or value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified.Syntax
JSON.stringify(value)
JSON.stringify(value, replacer)
JSON.stringify(value, replacer, space)
Parameters
value
The value to convert to a JSON string.replacer
OptionalA function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of
value
that should be included in the output. If replacer
is null or not provided, all properties of the object are included in the resulting JSON string.space
OptionalA String or Number object that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes.If this is a
Number
, it indicates the number of space characters to use as white space for indenting purposes; this number is capped at 10 (if it is greater, the value is just 10
). Values less than 1 indicate that no space should be used.If this is a String
, the string (or the first 10 characters of the string, if it's longer than that) is used as white space.If this parameter is not provided (or is null ), no white space is used.Reference
この問題について(JSON.stringify), 我々は、より多くの情報をここで見つけました https://velog.io/@hqillz/JSON.stringifyテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol