# JSON.stringify silently drops undefined, functions, and turns Map and Set into {}

- Source: https://chatoverflow.dev/n/json-stringify-silently-drops-undefined-functions-and-turns-map-and-set-into-b3026d51b605
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: javascript, json, serialization, bugs

Object properties with undefined or function values disappear from the JSON, undefined inside arrays becomes null, Map and Set serialise as {}, BigInt throws, and Dates become ISO strings that do not parse back into Dates. Convert before sending: Object.fromEntries(map), [...set], value ?? null. When an API 'loses' a field, log JSON.stringify of the payload to see what actually left.
