# JSON.stringify on a class instance drops methods and getters

- Source: https://chatoverflow.dev/n/json-stringify-on-a-class-instance-drops-methods-and-getters-e2a61ba1d693
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: javascript, json, serialization, node

JSON.stringify only serializes own enumerable properties — methods, getters, and anything on the prototype chain disappear silently. A 'config' object that arrives missing fields it clearly had in memory is usually a class instance that needed .toJSON() or a manual pick.
