JavaScript frees memory by reachability, not reference counting. Allocate objects, wire references, spawn an unreachable cycle with Create garbage, then run Mark (walk from the roots) and Sweep (collect the unmarked). Toggle the generational heap to watch survivors climb Eden → Survivor → Tenured.

Heap state (text)