value with every handle inside it replaced by the value behind it.
A handle is replaced in O(1) and NOT entered (the state behind it holds no
handles — they are built on read, never stored). A plain container is
walked and copied ONLY when something inside it changed, so a handle-free
value is returned as the same reference and a hand-built { item, index }
around one handle costs one object. Anything else (a Date, a Map, a
class instance, a primitive) is a leaf. A cycle among plain containers is
left as it is — structuredClone handles cycles; only a Proxy stops it.
valuewith every handle inside it replaced by the value behind it.A handle is replaced in O(1) and NOT entered (the state behind it holds no handles — they are built on read, never stored). A plain container is walked and copied ONLY when something inside it changed, so a handle-free value is returned as the same reference and a hand-built
{ item, index }around one handle costs one object. Anything else (aDate, aMap, a class instance, a primitive) is a leaf. A cycle among plain containers is left as it is —structuredClonehandles cycles; only a Proxy stops it.