DEV Community

Discussion on: Learn the JavaScript Proxy Object: Creating Immutable Objects

Collapse
 
gabbersepp profile image
Josef Biehler

Nice. Did not know Proxy object. Is this approach equal to Object.freeze()?

Collapse
 
nas5w profile image
Nick Scialli (he/him)

Object.freeze is shallow, so it’ll only make first level props immutable. Anything deeper would need to be recursively frozen.