Skip to content

Instantly share code, notes, and snippets.

@Oleg-Imanilov
Oleg-Imanilov / 1-circular-object.md
Last active Sep 1, 2021
How to handle circular references and maybe save some bandwidth.
View 1-circular-object.md

The Problem

If we have object like this

var x = {foo:1}
x.bar = x

We can't send it over http, because of circular reference. We also can't stringify it.