From: Robert R. <rra...@ya...> - 2000-12-11 20:55:08
|
I was wondering the point of this line when inheriting objects: MyObject.prototype = new DynObject(); Wouldn't it be better to say: MyObject.prototype = DynObject.prototype Because in your MyObject constructor you will be saying: this.DynObject = DynObject; this.DynObject(); so all of the properties in the DynObject constructor will be initialized, and the MyObject.prototype = DynObject.prototype line will set all of the methods equal to the MyObject. Using the first method you are always calling the constructor an extra time that is not needed (or is it?). -- // Robert Rainwater |