Overview The following code demonstrates how to use prototype base getters and setters in JavaScript. function Colour(red, green, blue, alpha) { this.value = [red, green, blue, alpha]; } Object.defineProperty(Colou... "red", { get: function () { return this.value[0]; }, set: function (x) { this.value[0] = x; } }); Object.defineProperty(Colou... "green", { get: function () { return this.value[1]; }, set: function (x) { this.value[1] = x; } }); Object.defineProperty(Colou... ......