JavaScriptSetters and Getters

Introduction

Setters and getters are object properties that call a function when they are set/gotten.

Remarks

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.