Object.defineProperty()

Object.defineProperty() is a static method defined on Object. MDN states that

Object.defineProperty() defines a new property directly on an object, or modifies an existing property on an object…

When I first came across this method, I wondered if defining a property with Object.defineProperty() was ultimately the same as defining an object property via assignment like so:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Elizabeth

Software engineer writing about programming, learning, & more. Highly caffeinated. In a committed relationship with the Oxford comma.