jsguides

Reference

JSON

JSON parsing and stringification.

  1. JSON.isRawJSON()

    JSON.isRawJSON() checks whether a value is a raw JSON object created by JSON.rawJSON(), helping avoid double serialization in data pipelines.

  2. JSON.parse()

    JSON.parse() converts a JSON string into a JavaScript value. Covers the reviver function, common errors, prototype pollution, and number precision handling.

  3. JSON.rawJSON()

    JSON.rawJSON() wraps a JSON primitive so JSON.stringify emits it verbatim. Use it for lossless 64-bit integers, exact unicode escapes, and tricky JS cases.

  4. JSON.stringify()

    Use JSON.stringify() to convert JavaScript values to JSON strings, with replacer and space parameters for filtering properties and pretty-printing output.