Replies: 1 comment
-
When serializing an array, properties on the array are ignored, so in your case the empty array is serialized as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here’s the MDN documentation link: Issue with serializing circular references
When we have an array with circular references, and pass it to
JSON.stringify()
, it works without any issues. For example:The code above runs sucessfully without throwing any errors or exceptions.
But since arrays are also objects, why does
JSON.stringify()
work with circular references in arrays? Could someone explain why this happens? 😄Beta Was this translation helpful? Give feedback.
All reactions