Javascript Complete Object Serialization (JSON) with Methods (Object Type) and Circular References

Object serialization can be a powerful feature for transferring or persisting objects, but when using JSON  serialization with JSON.stringify()  you have to keep in mind some things:

  • Values that do not have a representation in JSON (such as functions and undefined) are excluded
  • Objects are stored as ‘Object’ without a prototype reference
  • Circular references within an object can cause an error: too much recursion

If you want to have those features get cycle.js do it like this:




Comments (0)

› No comments yet.

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">


Pingbacks (0)

› No pingbacks yet.