douglascrockford / JSON-js

JSON in JavaScript
http://www.JSON.org/
8.7k stars 4.59k forks source link

Detect cyclic objects #132

Closed ildar-shaimordanov closed 2 years ago

ildar-shaimordanov commented 2 years ago
a = [];
a[0] = a;
my_text = JSON.stringify(a); // throws "TypeError: Converting circular structure to JSON"
douglascrockford commented 2 years ago

Thanks.