Reputation: 71
How does Object.defineProperty works for rewriting props. Is it implemented using js mechanisms (Is it possible to implement the same functionality using js ?)?
Upvotes: 2
Views: 94
Reputation: 664196
How does
Object.defineProperty
works for rewriting props.
By accessing the internal definition of the property (called "property attributes" in the spec).
Is it implemented using js mechanisms, and is it possible to implement the same functionality using js?
No. Object.defineProperty
is a primitive building block of the language.
Upvotes: 1