Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Call Object.freeze on the top-level object, then recursively visit every property value. If a value is a non-null object, recursively deep-freeze it as well. This ensures nested objects become immutable, unlike the shallow native Object.freeze.
Object.freeze only prevents direct property modifications on the frozen object itself. Recursing into nested objects applies the same restriction at every level, making the entire object tree truly immutable.
Updated Mar 2026