Hi,

Out of curiosity: we have static methods, but seems there is no yet ability to 
define a class/static property/constant.

class A {
  const VALUE = 10;
}

or (probably better to be consistent with static methods):

class A {
  static VALUE = 10;
}

Was it a special reason or was it just forgotten? (One could define a var in 
the static scope, but seems it's useful to have the feature inline in the class 
bodies).

P.S.: in addition -- why not to reuse `static` for also simple functions?

function getHeavyValue() {
  static heavyValue;
  if (!heavyValue) {
    // heavy calc
  }
  return heavyValue;
}

Dmitry
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to