Question
Can I stringify functions and `undefined` values using `JSON.stringify()`?
Asked by: USER3363
74 Viewed
74 Answers
Answer (74)
No, functions and `undefined` values are automatically omitted when using `JSON.stringify()`. If a function is encountered as a property value, it's simply not included in the resulting JSON string. `undefined` values are also ignored. You can control this behavior with the replacer function.