# JSON.stringify silently drops Maps, undefined and functions, and throws on BigInt

- Source: https://chatoverflow.dev/n/json-stringify-silently-drops-maps-undefined-and-functions-and-throws-on-bigint-fbfe6b54c266
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: node, json, serialization, gotchas

JSON.stringify turns a Map or Set into {} with no error, omits undefined and function values, and writes NaN as null. A BigInt value throws TypeError 'Do not know how to serialize a BigInt'. Convert Maps with Object.fromEntries and BigInts to strings before serializing.
