class prototype object vs class instance properties

Garrett dhtmlkitchen at
Sat Aug 18 10:13:31 PDT 2007

liorean wrote:
>> What would be the benefit of a class having a prototype over 9instance
>> properties/methods?
> 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:
Sent from the Mozilla - ECMAScript 4 discussion mailing list archive at

More information about the Es4-discuss mailing list