I'm new to ES6 and try to migrate old javascript code. Now my class use methods but is not clear why not all methods are attachetd to 'this'. Is not even clear if i can use methods as function (and pass as callback)
class MyClass{
construtor (parameters)
{
this.myInternalState = new ExternalClass ( this.method1CallBack );
this.varClass1
this.varClass2...
}
method1CallBack (){} //OK attached to this
method2 (parameter){} //KO not found in this object
}
Is not clear where is my mistake, in code syntax or in the interpretation of the method's use.