With this organisation, is it possible to reference the "id" property?
function house(id) { this.id = id }
house.prototype.buy = function() { }
house.prototype.sell = function() { }
house.prototype.buy.makeOffer=function(){
//how can id be printed?
console.log( 'id = ' + this.???? )
}
var h = new house(1)
h.buy.makeOffer();
I am trying to figure out the best way to organize a lot of prototypes for an object. As .buy will have a lot of sub-function an so will .sell() ie:
h.buy.makeOffer();
h.buy.inspect();
h.buy.counterOffer();
h.buy.signContact();
h.sell.prepare()
h.sell.advertise()
h.sell.reviewOffer()