Ultimate Guide to Getters and Setters in JavaScript
By Preethi RanjitGetters and setters are functions or methods used to get and set the values of variables. The getter-setter concept is common in computer programming: almost all high-level programming languages come with a set of syntax to implement getters and setters, including JavaScipt.