Update formatting

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-01-30 12:03:45 +02:00
parent 8b3ee1c65b
commit 3596467b4b
4 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:30+03:00
Serializes a JSON object containing circular references into a JSON format.
- Create a `new WeakSet()` to store and check seen values, using `WeakSet.prototype.add()` and `WeakSet.prototype.has()`.
- Create a `WeakSet` to store and check seen values, using `WeakSet.prototype.add()` and `WeakSet.prototype.has()`.
- Use `JSON.stringify()` with a custom replacer function that omits values already in `seen`, adding new values as necessary.
- ⚠️ **NOTICE:** This function finds and removes circular references, which causes circular data loss in the serialized JSON.