Setters and getters are object properties that call a function when they are set/gotten.
An object property cannot hold both a getter and a value at the same time. However, an object property can hold both a setter and a getter at the same time.
Defining a Setter/Getter Using Object.defineProperty
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0