Hello!
The problem is that the constructor "does not see" the class methods.
class SimpleClass{ constructor(){ this.x = this.getX(); } getX(){ return 'some value'; } consoleX(){ console.log(this.x); } } var simpleObject = new SimpleClass(); simpleObject.consoleX(); Prints undefined
I can not understand why - either I'm doing something wrong, or it should be.
If it should be like this, call the class methods inside the constructor (I understand that the antipattern is, well, really necessary).
Thank!