Hi Nikoms, thanks for stopping by with your question about
JSON.stringify, and the
rfdc (Really Fast Deep Clone) library.
The usual methods of copying an object or array only make a shallow copy, so deeply-nested references are a problem…
Circular references are one issue, but not the only one —
stringify do not play nice with any data types that are not primitive values.
JSON.stringify() will only work for nested objects and arrays that contain just primitive values, objects, and arrays.
For example, Date and RegExp objects will not work correctly.
I illustrate some of these examples of