static/class properties

Andrea Giammarchi andrea.giammarchi at gmail.com
Thu Sep 19 11:08:33 PDT 2013


the A.whatever is explicit to the class so it's the less ambiguous, IMO

I see already confusing to understand if properties will be defined in the
instance or in the class ... could not tell easily while I could, reading
`A.VALUE = 10;` instead.

Anyway, using that outside the class definition as:

```javascript
class A {
  // do whatever in here ...
  // that you want inherited/assigned too
}
const A.VALUE = 10;
```

is already good, if possible, and ambiguity free (but I cannot remember the
`const obj.prop = value;` state)

Hopefully in that way instances won't inherit a thing for sure ^_^
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130919/11c42ea7/attachment.html>


More information about the es-discuss mailing list