diff --git a/files/en-us/web/javascript/reference/global_objects/json/stringify/index.md b/files/en-us/web/javascript/reference/global_objects/json/stringify/index.md index 512e7b2c3b2eae4..b763251e6709f67 100644 --- a/files/en-us/web/javascript/reference/global_objects/json/stringify/index.md +++ b/files/en-us/web/javascript/reference/global_objects/json/stringify/index.md @@ -68,7 +68,7 @@ A JSON string representing the given value, or undefined. - {{jsxref("Boolean")}}, {{jsxref("Number")}}, {{jsxref("String")}}, and {{jsxref("BigInt")}} (obtainable via [`Object()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. {{jsxref("Symbol")}} objects (obtainable via [`Object()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. - Attempting to serialize {{jsxref("BigInt")}} values will throw. However, if the BigInt has a `toJSON()` method (through monkey patching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- {{jsxref("undefined")}}, {{jsxref("Function")}}, and {{jsxref("Symbol")}} values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](/en-US/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. +- {{jsxref("undefined")}}, {{jsxref("Function")}}, and {{jsxref("Symbol")}} values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](/en-US/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like JSON.stringify(undefined) or JSON.stringify(() => {}) or JSON.stringify(Symbol()). - The numbers {{jsxref("Infinity")}} and {{jsxref("NaN")}}, as well as the value [`null`](/en-US/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) - Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. - The special raw JSON object created with {{jsxref("JSON.rawJSON()")}} is serialized as the raw JSON text it contains (by accessing its `rawJSON` property).