What's the benefit of Object.freeze() not freezing objects within the passed object?

javascript

Solution

The answer lies in the point itself

Note that values that are objects can still be modified, unless they are also frozen.

Update:

There is no official information any where regarding the design decision of freeze() method

I think, basically for performance reasons they have took this decision, if we have wanted to make the internal objects also freezed, we would have to apply the method recursively. So this is a big overhead, so the design decision was made to avoid this.

If it was not the performance, the method would have behaved differently.

Problem

I was learning more about the methods of JavaScript's `Object` constructor on MDN and I noticed that the last sentence of Object.freeze's description reads: Note that values that are objects can still be modified, unless they are also frozen. A behavior like that seems like it should be opt-in. What exactly is the benefit of having to manually freeze a frozen object's objects recursively? If I'm freezing an object, why would I want the objects inside of it to still be mutable?

Original source