JavaScript: Object.isFrozen

By Xah Lee. Date: . Last updated: .
Object.isFrozen( obj)
Return true if it is impossible to {add, delete, change} properties.

Technically, when all of the following is true:

  1. If the object's “extensible” attribute is false. (cannot add properties)
  2. If ALL of the object's own property's “configurable” attributes is false. (cannot delete properties)
  3. If ALL of the object's own property's “writable” attributes is false. (cannot change property values)

[see Prevent Adding Property]

[see Object.freeze]

const x3 = {};
console.log(Object.isFrozen(x3)); // false
Object.freeze(x3);
console.log(Object.isFrozen(x3)); // true
JS in Depth
XAH  BUY NOW

JS in Depth

JS Obj Ref

DOM


JS Obj Ref

Object Object

prototype