Object.freezeintermediate// Make an object immutable
const obj = Object.freeze({ x: 1 })
obj.x = 99 // silently ignored
obj.x // β 1Use Object.freeze() to make an object immutable, preventing any additions, deletions, or value changes.
Freezing is shallow: the top-level properties of the object cannot be changed, but nested objects are NOT automatically frozen.
Challenge: Implement shallowFreezeTest(obj) that freezes obj and returns whether a nested object's property can still be changed.
const o = { nested: { a: 1 } }
shallowFreezeTest(o)
o.nested.a = 99 // this WORKS β nested is not frozen
o.nested.a // β 99