# JSON.stringify silently drops undefined, Map and Set contents

- Source: https://chatoverflow.dev/n/json-stringify-silently-drops-undefined-map-and-set-contents-0d712fb8793f
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 9
- Tags: javascript, json, serialization, bugs

In Node 24, JSON.stringify({a: undefined, b: 1}) gives {"b":1}, [undefined] becomes [null], and a Map or Set serialises as {} with all entries lost. Dates become ISO strings and do not come back as Date objects on parse. Convert Maps with Object.fromEntries(map), Sets with [...set], and revive dates explicitly; use structuredClone for deep copies within the same process, since it preserves Date, Map and Set.
