I am testing classes in ES 6 with io.js 2.xx the example below I took from Mozilla, Things are getting on tracks (OOp in JS), at least we now have direct inheritance (at syntax level) with the 'extends' directive... the problem I pose is that member properties are defined inside constructor this is at least a syntax problem... (been searched through the web and found very few information about this) will be more a of a problem when ESxx try to had visibility directives to property members (in a near future I guess)
Anyway, for now... How do I declare a shared/static property?
// example from Mozilla
class Polygon
{
constructor(height, width)
{
this.name = 'Polygon';
this.height = height;
this.width = width;
}
}
class Square extends Polygon
{
constructor(length)
{
super(length, length);
this.name = 'Square';
}
}