Skip to main content

JSON

Less than 1 minutefeaturees-standard

JSON

Since JSON object is missed only in very old engines like IE7-, Core-JS does not provide a full JSON polyfill, however, fix already existing implementations by the current standard, for example, well-formed JSON.stringifyopen in new window. JSON also fixed in other modules - for example, Symbol polyfill fixes JSON.stringify for correct work with symbols.

Modules

Types

interface JSON {
  stringify(
    value: any,
    replacer?:
      | Array<string | number>
      | ((key: string, value: any) => any)
      | null,
    space?: string | number
  ): string | void;
  [Symbol.toStringTag]: "JSON";
}

Entry points

core-js(-pure)/es|stable|actual|full/json/stringify
core-js(-pure)/es|stable|actual|full/json/to-string-tag

Example

Exampleopen in new window:

JSON.stringify({ "𠮷": ["\uDF06\uD834"] }); // => '{"𠮷":["\\udf06\\ud834"]}'