In JavaScript, you may have heard of getters and setters. Let’s take a look at what these things are.
First, a setter is used to set the value of a property. A setter gets called each time the value of the property is changed. In other words, it…
In JavaScript, you can create an object literal as shown in the listing below:
var cat = { name: 'foo', age: 9 };
At first sight, it looks like the object cat has two properties with a string and number value. However, it’s much more than that to…