Define static properties and prototype properties with the class syntax

Glen Huang curvedmark at gmail.com
Fri Dec 12 20:36:41 PST 2014


Currently, es6 doesn’t seem to let you define static properties and prototype properties with the class syntax, by that I mean this in es5:

function Foo() {}
Foo.bar = 1;
Foo.prototype.baz = 2;

Is it possible to allow this in es6 with the class syntax? Or it belongs to es7? Or it’s simply a terrible idea?

Thanks.



More information about the es-discuss mailing list