class prototype object vs class instance properties
dhtmlkitchen at gmail.com
Sat Aug 18 10:13:31 PDT 2007
>> What would be the benefit of a class having a prototype over 9instance
> Prototype properties can be shadowed by instance properties without
> being changed, prototype properties are fallbacks if the instance
> property does not exist, and prototype properties are not part of the
> actual instance, so can be used as memory footprint reduction if one
> has lots of instances that don't need separate values for that
> instance property.
That's pretty much how es3 works, then.
Instance methods in the prototype, unique properties will be defined on the
View this message in context: http://www.nabble.com/class-prototype-object-vs-class-instance-properties-tf4288010.html#a12215225
Sent from the Mozilla - ECMAScript 4 discussion mailing list archive at Nabble.com.
More information about the Es4-discuss