var p = {
x: 1, // value property
y: 1, // value property
diag: function() { return this.x - this.y; }, // value property
get area() { return this.x * this.y; }, // property getter
set area(a) { this.x = Math.sqrt(a); this.y = Math.sqrt(a); } // property setter
}