Define static properties and prototype properties with the class syntax

Rick Waldron waldron.rick at
Sat Dec 13 10:24:40 PST 2014

On Sat Dec 13 2014 at 6:04:10 AM Glen Huang <curvedmark at> wrote:

> After thinking about it, I think you are right. Defining this defaults
> property is almost like defining a global variable, that modifying it might
> affect lots of objects are created with the constructor.
> It’s probably a good thing that class syntax doesn’t support it, but I
> reckon a lot of jquery plugin authors would do “class Foo {}; Foo.defaults
> = {};” nonetheless.

I can't speak for all jQuery plugin authors, but in jQuery Core, static
class-side properties (as data and/or functions) are used extensively, eg.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list