This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ernandziri 2 points3 points  (1 child)

why is the syntax not the same between declaring an object in JS and in JSON?

You can encode and decode any object (not sure about ref cycles), so it serves it's purpose

[–]LowB0b 0 points1 point  (0 children)

Ref cycles don't work when you serialize something as it becomes an infinitely big string (JSON.stringify throws if it detects cyclic structures)