Why are non-method properties in a prototype an anti-pattern?

John J Barton johnjbarton at johnjbarton.com
Wed Nov 7 09:52:29 PST 2012


On Wed, Nov 7, 2012 at 9:17 AM, Axel Rauschmayer <axel at rauschma.de> wrote:

> In theory, one can use prototype properties to provide default values for
> instance properties.
>

In practice instances are free to write on these values in addition to
using them as defaults. Then suddenly the 'default' is changed for other
instances. It is then you realize that the theory is not a very good one.

jjb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121107/98925630/attachment.html>


More information about the es-discuss mailing list