In ES5, we can declare static properties and methods for constructors:
function Person(name){
this.name = name;
}
Person.staticProperty = 123;
Person.staticMethod = function(){};
Some built-in objects also provide static properties and methods:
Math.PI; // 3.141592653589793
Math.floor(33.7); // 33
However, ES6 classes allow only static methods:
class Foo {
static staticMethod(){};
static staticProperty: 123; // Error
}
What is the reasoning behind not allowing static properties?