JS Built-ins
ObjectObject.isFrozenbeginner

Object.isFrozen() β€” plain object

πŸ“– 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()

Object.isFrozen(obj) returns true if the object is non-extensible AND all its properties are non-configurable AND non-writable.

A plain object is not frozen by default.

Challenge: Implement checkFrozen(obj) that returns whether the object is frozen.

πŸ’‘ Hints (1)
  • β€’ Object.freeze() is the standard way to make an object frozen