JS Built-ins
ObjectObject.isFrozenintermediate

Object.isFrozen() β€” empty object after preventExtensions

πŸ“– Usage Example
// Check if an object is frozen
const obj = { a: 1 }
Object.isFrozen(obj)    // β†’ false
Object.freeze(obj)
Object.isFrozen(obj)    // β†’ true

Use Object.isFrozen() to verify that an object is fully immutable (no additions, deletions, or value changes allowed).

Object.isFrozen() β€” empty + non-extensible = frozen

An empty object that has been made non-extensible is considered frozen, because there are no writable or configurable properties to violate the frozen constraint.

Challenge: Verify that an empty object after Object.preventExtensions is considered frozen.

πŸ’‘ Hints (1)
  • β€’ An empty non-extensible object trivially satisfies all frozen conditions