Here I'm hoping to define an object with 2 levels:
var b1=new mybuilding()
var r1=new b1.rooms()
alert(r1.totalrooms+" "+b1.totalrooms) //How do I get it to alert "5" and "5"?
with change to "this.roomcount" at all levels affecting only the one that's binded to the root constructor object. In other words, so the above example alerts "5" and "5", not "5" and "3". I don't understand the mechanism behind prototype, especially when it's used on top of another prototype property. Also, when I define a constructor function onto of the main constructor, what happens exactly in terms of scope? Is it possible to actually be able to use the syntax:
instead of having to use the keyword "new" twice to get to the second level?