Object.freeze Playground

Bayu’s cabinets: Object.freeze padlocks an object, but how deep? Run your own statements, in a plain script or with use strict. An interactive Object.freeze…

Why it matters

"I froze it, why did it still change?" This bug comes from shallow freezing. Knowing it means understanding why immutable state needs deepFreeze or a special structure, and why a plain script fails silently on frozen objects.

The key idea

Freeze is shallow: one layer only

Common mistakes

Try it in this playground