Object.defineProperty()
Last updated
Was this helpful?
Last updated
Was this helpful?
⟩ ⟩ ⟩ ⟩ ⟩ Object.defineProperty()
define/update a on an object, and return the object.
The only reason (I can think of) why Object.defineProperty() is (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.
replit:
⟩
You could ask instead if you want to.