Skip to content

Instantly share code, notes, and snippets.

@Oleg-Imanilov
Oleg-Imanilov / 1-circular-object.md
Last active September 1, 2021 02:33
How to handle circular references and maybe save some bandwidth.

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.