DEV Community

payalpatel26
payalpatel26

Posted on

Get & Set with Object in js

You can add a property with getter and setter in both ways.
The first way add property using get and set inside the object.
The second way add property using get and set with Object.defineProperty() method.
you can change the value of the object with get and set using Object.defineProperty() method.

https://github.com/payalpatel26/Getter-SetterinJs.git

Top comments (0)