`JSON.parse` and `JSON.stringify` handle strings, numbers, booleans, null, arrays and plain objects. They drop `undefined` and functions, and throw on BigInt and circular references.
JSON.stringify({ v: 1n }); // TypeError
JSON.stringify(obj, (k, v) => typeof v === "bigint" ? v.toString() : v);Always wrap `JSON.parse` of untrusted input in try/catch.