📘Object.defineProperty()
JS ⟩ value ⟩ object ⟩ property ⟩ update ⟩ Object.defineProperty()
define/update a property on an object, and return the object.
when creating a new property, the omitted attributes are false by default.
when modifying an existing property, the omitted attributes are left unchanged.
The only reason (I can think of) why Object.defineProperty() is static (instead of an instance method) is that an object may not inherit methods from Object.prototype, which means obj.defineProperty()
may fail if this is the case.
Last updated